Posts by Stephen Meehan

    I've checked another website using Perch/Google Maps API and I can confirm it doesn't set cookies.


    Thanks for your input Clive, but I could do with knowing for sure how the Perch/Google Maps API Implementation works

    So, I'm still looking for answers to these two questions (from Perch Support) .


    Does your Maps Platform API Implementation enable you or any party to gain access to information about users of the Maps Platform APIs?

    Yes

    No


    Will you obtain or cache the user's location?

    Yes

    No


    I've submitted a question via the account chat.

    Thanks Clive. I'll try the chat option.


    The implementation is default Perch. Trying to find out information about what Google Maps API does regards to tracking/cookies is tricky. I was hoping the developers that made the Maps integration would have some insights.

    Hi


    I'm using a service called Termly, to manage cookies and generate policy docs.


    I'm using the Perch implementation of Google Maps, as I understand it that uses the 'Google Maps API'

    A couple of the questions relates to 'Tracking Technologies'


    Can Perch support answer these questions?


    Does your Maps Platform API Implementation enable you or any party to gain access to information about users of the Maps Platform APIs?

    Yes

    No

    Will you obtain or cache the user's location?

    Yes

    No

    Cheers.

    Hey thanks, that nudged me in the right direction


    Installing a fresh copy of Perch doesn't create a htaccess file for you, so I had to go deep into the archives and find another site I made with a basic htacess file, replaced it with this and cleared the cache.


    Code
    1. <IfModule mod_rewrite.c>
    2. RewriteEngine on
    3. # # Redirect to PHP if it exists.
    4. # e.g. example.com/foo will display the contents of example.com/foo.php
    5. RewriteCond %{REQUEST_FILENAME} !-f
    6. RewriteCond %{REQUEST_FILENAME} !-d
    7. RewriteCond %{REQUEST_FILENAME}.php -f
    8. RewriteRule ^(.+)$ $1.php [L,QSA]
    9. </IfModule>

    Site appears to be working locally now. Phew.

    Hi


    It's been a while since I worked with Perch (not Runway), I must be missing something obvious - but I just can't see it?


    When visiting a local version of the website I'm seeing this:


    Screenshot-2022-03-13-at-11-35-00.png


    It's downloading the index file?


    - I'm working from a copy of a site from an old server, I've dragged the `public_html` folder off the server so I'm sure all the files are there

    - I've setup the database and updated the config

    - This is an old copy of Perch, so I've made sure I'm using PHP 7.3 locally (for now) as there was an issue with magic quotes being removed in PHP 7.4+

    - There are no errors in the logs

    - My `htaccess` is in the root and looks like this



    I bet it's something super simple...


    Anyone ever hit this?



    Note. Perch works locally if I install a brand new website, I've looked at the fresh install and compared it to this site and nothing obvious seems different?

    Hi,


    My client has requested a specific CRM to be used on a Perch Runway website, the integration is typical - embed a form (iframe) submissions go directly into the CRM, Perch Forms is not being used.


    However the form embed uses cookies, which is a problem in Safari. As Safari does not allow an iframe to set cookies unless a cookie has been set previously in a visit to the domain that is trying to set the cookie.


    The developers of the CRM have created a neat workaround to this Safari only issue.


    They detect Safari, detect the lack of a cookie, redirect back to their website (where the form code is hosted) then redirect back to the website hosting the form. All this happens in the blink of an eye.


    This works in their test environments, but not on the Perch powered website.


    I contacted the developer and they told me:


    "All the page does is set a cookie and then 'redirect to the referrer'. It seems it is getting the referrer preview.website.org/ rather than preview.website.org/services - this might be because of client-side routing or similar on your website perhaps?"



    So to recap, the form is on preview.website.org/services, the script bounces the request to the CRM servers, the script redirects to the referrer which should be https://preview.website.org/services but it thinks the referrer is preview.website.org/ so it's not working?


    Anyone got any ideas what's going on here? :/

    Solved.


    Hi,


    I'm using a solution originally posted by dazglaser and answered by @hus_hmd and ryan


    The code provides the ability to use different templates based on the subcategory level. This gives similar template options as the <perch:pages id="subitems" encode="false" /> but for subcategories.


    It works great, but currently it displays all subcategories.


    I'd like to be able to filter out any subcategories that aren't assigned to an item/post.


    I usually achieve this by using this code:


    Then in the template.html, I use a perch:if


    Here's the code from the original post:


    How would I modify this code to filter out any subcategories that aren't assigned to an item/post? :/

    ...are you outputting the region with perch_content() or perch_content_custom()?


    Aha!


    I was using:

    Code
    1. perch_content_create('body', array('template' => '_primary/primary--projects.html')); 
    2. perch_content('body');

    Changing it to


    Code
    1. perch_content_create('body', array('template' => '_primary/primary--projects.html')); 
    2. perch_content_custom('body');

    fixed the problem.


    That was it. Thanks so much.

    Hi,


    So, I was running PHP 7.4.2 locally, and debug output this message...


    Code
    1. Array
    2. (
    3. [type] => 8192
    4. [message] => Function get_magic_quotes_runtime() is deprecated
    5. [file] => /Users/stephenmeehan/Repositories/burgess-hill/cms/perch/core/lib/PerchDB_MySQL.class.php
    6. [line] => 375
    7. )


    The live site isn't running that version of PHP, so I've changed it to PHP 7.3.9. That message/error is gone.


    But I'm still seeing the wrong perch_page_path

    Hi,


    Hopefully a quick one...


    perch:showall is displaying perch_page_path as /perch/core/apps/content/edit/index.php when it should be... well a page path. This is on a nested page. It's making any perch:ifbased on the page path break.


    Anyone come across this before?



    • Perch Runway: 3.1.5, PHP: 7.4.2, MySQL: mysqlnd 7.4.2, with PDO
    • Server OS: Darwin, cgi-fcgi
    • Installed apps: content (3.1.5), assets (3.1.5), categories (3.1.5), perch_blog (5.6.1), perch_forms (1.12), pipit (0.6)
    • App runtimes: <?php $apps_list = [ 'perch_forms', 'perch_blog', 'pipit', ];
    • PERCH_LOGINPATH: /perch
    • PERCH_PATH: /Users/xxxxxxx/Repositories/xxxxxxx/cms/perch
    • PERCH_CORE: /Users/xxxxxxx/Repositories/xxxxxxx/cms/perch/core
    • PERCH_RESFILEPATH: /Users/xxxxxxx/Repositories/xxxxxxx/cms/perch/resources
    • Image manipulation: GD
    • PHP limits: Max upload 32M, Max POST 8M, Memory: 128M, Total max file upload: 8M
    • F1: xxxxxxx
    • Resource folder writeable: Yes
    • SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
    • REQUEST_URI: /perch/core/settings/diagnostics/
    • DOCUMENT_ROOT: /Users/xxxxxxx/Repositories/xxxxxxx/cms
    • HTTP_HOST: xxxxxxxlocal

    Ah, yes that makes sense.


    I just hoped I was missing something.... I was thrown by event_date_upcoming, it was showing up when I used perch:showall.


    event_date_upcoming is generated using an each callback function, the dates are in a perch:repeater.


    The setup I've got is, each item in the collection can have multiple dates, which are set in a perch:repeater. I'm using the each callback function to change the order of the dates into reverse chronological order. As I can't be sure the admin user will always enter multiple dates in the correct order.


    I was hoping to use event_date_upcoming to filter the collection, but as you pointed out the "each callback function is executed after Perch queries the database"


    Which is fine, I guess. I'll just add a date field in the template and request admin to set the last date of an event manually (so it's in the database). I'll then be able to filter on that. It'll work but it's an extra (small) step for the admin - they all add up :)


    Thanks for confirming how it works, it's good to know.

    Looks like Perch can't use an ID generated from each as a filter value? Is that correct?


    I did this as a test:

    Code
    1. perch_collection('Events', [
    2. 'template' => '_events/events--listing.html',
    3. 'filter' => 'postDateTime', // Date item was created 2020-02-20 14:54:00
    4. 'match' => 'eq',
    5. 'value' => '2020-02-20 14:54:00',
    6. 'each' => function ($item) {
    7. ...
    8. return $item;
    9. },
    10. ]);

    postDateTime is a timestamp for when the item was created, and the value 2020-02-20 14:54:00 is just hardcoded in for now, as I know it's the same as postDateTime  . I just wanted to see if it'd work... And it does. Only the item that matches the filter/value is shown.


    So.... Is there a way to get Perch (Runway) to use an ID generated in each as part of filter/value?

    Hi,


    I want to exclude any event items that are older that $now, so only events that are happening now or in the future are displayed.


    The value of event_date_upcoming is different for each item in the perch_collection


    Does this look like it should work?



    event_date_upcoming is generated via a callback, would that have any impact on this working?


    :/

    Hi,


    I was hoping Perch Support (hi Drew) could clarify something for me regarding the Members app...


    Does the Members app allow multiple logins using a shared username and password?


    ---


    I've used the Members app to password protect a blog and all it's subpages - works great, I was delighted at how easy it was to get setup.


    My client wants to provide a single login to their team. They want the simplicity of emailing a URL to a password protected (staff only) blog, and a single login that everyone in the team will use.


    I've done my own tests to see if multiple visitors can access the blog using the same login, and it appears to work fine. Using the same user/pass, I've logged in on my laptop, and logged in via browserstack.com. Members App seems to allow multiple logins using a single user/pass.


    ---


    There are couple of (very) old forum posts from Rachel and Drew that suggest the Members App does allow multiple logins using the same user/pass. But these are old posts.


    • I'd like to know 'officially' if this is ok?
    • Is there any reason why this might stop working if 10, 20, 30+ people login using the same username and password?
    • Or does the app not mind?

    :/