Posts by Graham

    I see that all new add-ons upgrades will be listed under the page address that's unavailable to anyone without a subscription. So where's my incentive to subscribe if I have no idea what add-ons upgrades you've made available? Have you considered something called marketing? That's where you promote and incentivise things so that people know what's available and what they are missing - and then they might subscribe?

    Are you still getting the issue, Mike. I see that now and again. I think its the user pressing submit twice (in my case), when they think they are not getting a quick response to the submit button. It only happens to some of my sites occasionally.

    Thank you from us and all my customers for developing Perch and saving us from WordPress development.

    Wishing you all the luck in the future, with whatever you both do next. It has been good to have known you and met you.

    For the last two Runway installs I've had issues getting cron to then run on my server setup (in order to schedule the backups to Amazon S3). I now know the cause, but I'm unsure if its specific to my server hosting setup. I also have a solution, so I have decided to publish the info here for others. If you have the same issue and solved it a different way, I'd love to hear.


    On a Runway install, the config.php contains the following code at the top ...


    PHP
    1. <?php
    2.     switch($_SERVER['SERVER_NAME']) {
    3.         case 'www.mysite.com':
    4.             include(__DIR__.'/config.www-mysite-com.php');
    5.             break;
    6.         default:
    7.             include('config.production.php');
    8.             break;
    9.     }


    The file config.www-mysite-com.php contains the sitepath, schedule_secret and database settings. The file config.production.php contains nothing except for an opening <?php statement. This all works perfectly when using Runway with http or https because the variable of $_SERVER['SERVER_NAME'] has a value.


    When using cron to set up an hourly job, I use a statement like this ...


    Code
    1. /opt/cpanel/ea-php72/root/usr/bin/php /home/mysite/public_html/perch/core/scheduled/run.php xxxxxxxxxx


    The cron job runs ok but doesn't do anything. After digging around I see this error ...

    'PHP Parse error: syntax error, unexpected end of file in /home/mysite/public_html/perch/config/config.production.php on line 1'


    My hosting company tells me that the cause is that the variable of $_SERVER['SERVER_NAME'] doesn't have a value when the PHP statements are run in CLI (Command Line Interface). Therefore the 'switch' statement can't do the necessary file 'include' and it takes the default case and tries to run the code in config.production.php. But that file just contains an opening (but no closing) PHP statement.


    My Solutions


    I've done two different solutions for this (on the 2 sites where I've encountered it). On one I removed the switch code and just pasted all the Perch statements into config.php as I knew I would not need a secondary set of sitepath and database setings. On the other site I've replicated the contents of config.www-mysite-com.php into config.production.php.


    Has anyone else come across this and what's your solution?

    Seems no-one here has tried this, so I've given it some tests.

    The only place I can find the web path to the bucket is in buckets.php, so this should work ...


    Code
    1. 'b2backup' => [ 
    2.   'type' => 'amazon_s3', 
    3.   'region' => 'us-west-000', 
    4.   'web_path' => 'https://s3.us-west-000.backblazeb2.com/runway-xxxx', 
    5.   'file_path' => 'runway-xxxx', 
    6. ], 


    But Debug reports being unable to find the web path. It appears that the domain amazonaws.com gets hard-coded into the request, rather than using the web-path I've provided ...

    Code
    1. [message] => Error executing "PutObject" on "https://s3.us-west-000.amazonaws.com/runway-xxxx/db_test_202005071333.sql.gz"; AWS HTTP error: cURL error 6: Could not resolve host: s3.us-west-000.amazonaws.com (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

    We use Backblaze to back up our computers. Backblaze have announced an S3 compatible API for their B2 Cloud Storage, and it is much cheaper than Amazon S3. Has anyone here tried to get Runway backup using this? I thought I’d ask before I attempt to get it working.

    I've been asked to retrospectively add search into a RunWay site. After a fair amount of work (and template adjustments) this is now done. I've also learned some future things affecting the way I build future templates, in case search needs to be added. But I have one issue I cannot resolve ...


    I hold 'vacancies' and 'news' items in collections. Each is set with a 'visible' switch, enabling the author to set up news or a vacancy in advance and then make it visible on pages when they are ready. However, these news/vacancy items still appear in search results whether or not the switch is set.


    Is there a way I can control what is searched and not return a result if the visible switch is not set to 'yes'?


    The template code for each occurrence of this switch is consistent in all templates ...

    <perch:content id="visible" type="checkbox" label="Visible?" value="yes" searchable="false" suppress divider-before="Make this Item visible?" />


    Thanks, Graham

    Thanks. I didn't even know that attribute existed. A search of the documentation only shows it in perch_content_create options. That's a function I've never needed to use, so never spotted it. BTW it works and solves the problem.

    Is there a way of suppressing output from search results? I have a perch:content 'checkbox' and 'select' where the value or option text is appearing in perch:search id=“result_excerpt”. Both the fields have suppress on them and neither field has a title set. Is there another parameter that stops output appearing in search results, or have I missed something?

    I had the same problem. I've just checked my code and I've commented out the 'PerchUtil::redirect('/members/');' line and that made it work. Perhaps it is a timing issue and the 'log_out' doesn't have sufficient time to clear out cookies before the PerchUtil redirect comes into effect? My site setup is such that if you're not logged in, you get redirected to the members home page (to log in again) anyway. So, the PerchUtil line isn't really needed.