Posts by Byron Fitzgerald

    The rewrite rule is correct, so there will be something conflicting with it.


    Can you confirm that the RewriteRule ^blog/([a-zA-Z0-9-/]+)$ blog/post.php?s=$1 [L] works fine. Check it works when you change it to something else as well like RewriteRule ^news/([a-zA-Z0-9-/]+)$ blog/post.php?s=$1 [L].


    Check in your blog/ folder for an additional .htaccess, as this will take precedent over the root file

    Is this regular perch or is it runway?


    If you are using runway you'll need to setup a route for the preview URL, and make sure it has priority over your post route.


    If not, can you post your full .htaccess file as there may be something else causing it to fail

    You're probably best emailing the perch team directly at directors@perchrunway.com.


    If you want to try debug it further the response from the activation call can be found in perch/core/lib/PerchAuthenticatedUser.class.php on line 255. If you output the json result you should get some more info on what the actual problem is

    You might be able to delete it through SQL queries as the regions look very similar.


    you could try get all the region ID's first, then get store them as a comma separated string. Delete all the index and items from their respective tables, then lastly delete from the regions table

    SQL
    1. SELECT regionID FROM `TABLE_NAME`.`perch3_content_regions` WHERE (`regionKey` LIKE '%11111111%');
    2. DELETE FROM `TABLE_NAME`.`perch3_content_index` WHERE (`regionKey` IN(244, 243, ...));
    3. DELETE FROM `TABLE_NAME`.`perch3_content_items` WHERE (`regionKey` IN(244, 243, ...));
    4. DELETE FROM `TABLE_NAME`.`perch3_content_regions` WHERE (`regionKey` LIKE '%11111111%');

    I would not do this on a production site, so take a back up and perform the operations on that and then reupload the DB if it works

    It looks like an SQL injection attempt through your lang query parameter.


    As you don't run a check on what the value of the lang parameter is, it looks like any value entered creates a new region.


    You'll want to add a list of acceptable lang values then do a check if the lang value entered is acceptable, then add a default for when it doesn't match.


    You could try something like the following

    Code
    1. $available_languages = array('en', 'fr', 'de', 'es');
    2. $lang = $_SESSION['lang'] ?? 'es';
    3. if (isset($_GET['lang'])) {
    4. $lang = in_array($_GET['lang'], $available_languages) ?
    5. $_GET['lang'] : 'es';
    6. $_SESSION['lang'] = $lang;
    7. }

    I think the errors are unrelated to why the addresses won't add, as those lines are for retrieving the location, which as none have been added yet is probably why the errors are showing.


    The error 'Sorry, that location could not be created.' appears when the Factory create method failed. This is normally always an error in the DB, where the query is invalid or there are missing required fields. If you have PERCH_DEBUG set to true, there should be an error in that debug which should explain why it's failing

    Is there anything in the Perch Debug output? The geocoding actually happens with the perch scheduled tasks so I doubt it has anything to do with the API key or geocoding.


    Have the DB tables been created? Should be looking for {DB_PREFIX}_root_locator_addresses, {DB_PREFIX}_root_locator_index, {DB_PREFIX}_root_locator_tasks

    I did notice that on my test install but I thought it was because I updated a previous install. Collections are still there and work exactly the same as before. You'll have to enter the URL manually to get there though I assume now. If you try yoursite.com/admin/core/apps/content/manage/collections/ you should be able to get to them

    Going off of the download from https://account.perchcms.com/licenses/runway I've gone through and checked what's been changed / added. So in lieu of any release notes here's what I've found


    Most of the changes seem to be auto formatting and consolidating standard perch with runway. Then there are some minor style changes which basically just change some borders and drop shadows.


    There is a new "Features option" for the sidebar menu, but as far as I can tell this is the same as a menu item, just a bit harder to find where to add them.


    There is a new collection index which you can't get to without entering the URL yourself. I assume the indexes are to provide better search results but I can't see anywhere where they are used apart from creating editing and deleting them in the admin area. Unfortunately I don't know what triggers the creation of the tables so they can't be made anyway, maybe a feature in the future.


    There are a few echo "heress" left in as well but apart from that, that's everything.


    Hopefully the download is incomplete and there is more to come, but who knows?

    If you open up your DB in phpmyadmin or another DB management tool, you should be able to execute the query.


    That count query is a check to see if the promotion code limit has been reached, so the issue is stemming from perch not being able to find/verify the promotion code.


    Whilst the SQL versions might be the same, the sql_mode could be different which could be making queries fail, though perch should log that in the debug. You can check this with the following query. Depending on your servers you might not be able to change this, but it might give you a bit more info

    SQL
    1. SELECT @@GLOBAL.sql_mode;

    The check that happens before that line appears is

    Code
    1. if(strtoupper($data['discount_code'])!=strtoupper($code))

    Where $data is the cart info, and the $code is the Promotions discount code. Would be worth checking the promotion is set up correctly on the staging site, and then checking the result from the query is what you expect it to be.

    SQL
    1. SELECT * FROM perch3_shop_promotions WHERE promoFrom<='2021-11-23 18:38:00' AND promoTo>'2021-11-23 18:38:00' AND promoActive=1 AND promoDeleted IS NULL ORDER BY promoOrder ASC

    I haven't used the v2 captcha in quite a while, but I think you need to use a callback for it to actually update the input value. You could try something like this (Untested though)

    Code
    1. <perch:input type="hidden" id="g-recaptcha-response" class="g-recaptcha-response"/>
    2. <div class="g-recaptcha" data-sitekey="YOUR_RECAPTCHA_SITE_KEY" data-callback="renderCallback"></div>
    3. <script>
    4. var renderCallback = function(response) {
    5. var $response = document.querySelector('.g-recaptcha-response');
    6. $response.value = response;
    7. }
    8. </script>

    The first error is caused as perch can't find a template for the collection. Check if the collection key is correct and that it has a collectionTemplate set in the DB for the collection. If both are correct you can pass through the template as an option which should fix the notice.


    As it doesn't look like the template is found I imagine that the rest of the process of fetching the data isn't working. Are there any errors in the perch debug?