Posts by Byron Fitzgerald

    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?

    We had a server which updated their MySQL version to 8, which ended up breaking a few things on the site. It's a shop which uses variants, and the main issue was that users couldn't add products with variants.


    In MySQL 8 the way regexp work have changed and here is a brief outline one the changes that affect perch

    Quote

    The Spencer library supports word-beginning and word-end boundary markers ([[:<:]] and [[:>:]] notation). ICU does not. For ICU, you can use \b to match word boundaries; double the backslash because MySQL interprets it as the escape character within strings.


    So if you are using perch shop or any regex filters in your collections or perch_content_custom functions then you'll need to update [[:<:]] and [[:>:]] to \\\\b.


    As you might not be locally developing on MySQL 8 what I did was replace [[:<:]] with a global BOUNDARY_START and [[:>:]] with BOUNDARY_END then in your local config you can set these to what you need without needing it go backwards and forwards

    Very strange that they are blocking outgoing SMTP, never heard of a hosting company doing that before.


    The perch mailer class uses PHPMailer under the hood so you can rely on that to deliver emails, but without SMTP it can be 50/50 whether the email will be delivered without it being marked as spam.


    If you wanted to go with Sendgrid you'd need to update the PerchEmail class (/admin/core/lib/PerchEmail.class.php), however as your editing a core file support would be invalidated and when/if perch release another update it could cause other issues down the line.


    Otherwise the only other options I see is getting them to switch on SMTP for you, or moving to another host again.