Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #1468601

    We are running into errors when we go to publish page edits

    When publishing page edits we get the error: “Updating failed. The response is not a valid JSON response.”

    Things we have tried so far:
    Updating the theme – the same issues persist
    Make sure all plugin are updated – the same issues persist
    Deactivating all plugins – the same issues persist
    Worked with our host to make sure there were no issues on their end – the same issues persist

    #1468622

    Hey theminacompany,

    Thank you for the inquiry.

    Have you tried temporarily deactivating the plugins? It’s possible that one of the plugins is causing the update issue. Please deactivate all plugins one by one to check which one is causing this issue and let us know if this solves the problem.

    Best regards,
    Ismael

    #1468661

    Yes, as mentioned above, I have deactivated all the plugins and the issues still persists.

    #1468672

    Hi,

    Thanks for the update. Are we allowed to temporarily deactivate plugins for testing purposes?

    Best regards,
    Rikard

    #1468673

    Yes, please go ahead

    #1468675

    Hi,

    Thanks for that. I tried updating the front page, but I can’t see the problem there. On which pages are you seeing it?

    Best regards,
    Rikard

    #1468678
    This reply has been marked as private.
    #1468701

    Hi,

    Thank you for the update.

    It might be an issue with the embedded code in the Code Block element.

    
    <div class="sked-portal-container" style="">
      <iframe id="sked-portal" sandbox="allow-top-navigation allow-scripts allow-forms allow-same-origin" style="border: none; height: 75vh; width: 100vw; " src="https://portal.sked.life/new-patient?key=sfdsfdsf">
      </iframe>
    
    <script>
        (function(){
          try {
            const redirectUrl = "https://blossomfamilychiropractic.com/schedule-appointment/appointment-thank-you-orlando/";
            const messageHandler = function(event) {
              if(event && event.data) {
                const skedMessage = JSON.parse(event.data);
                if(skedMessage && skedMessage.actionType === 'confirm') {
                  window.location.href = redirectUrl;
                }
              }
            };
    
            window.addEventListener('message', messageHandler);
          } catch(err){};
        })();
        </script></div>
    

    Instead of embedding this code directly to the page, try creating a custom shortcode for it. Example:

    function sked_portal_shortcode() {
        ob_start();
        ?>
    <div class="sked-portal-container" style="">
            <iframe id="sked-portal" sandbox="allow-top-navigation allow-scripts allow-forms allow-same-origin" style="border: none; height: 75vh; width: 100vw;" src="https://portal.sked.life/new-patient?key=sfsfsdfsfssfds"></iframe>
            <script>
                (function(){
                    try {
                        const redirectUrl = "https://blossomfamilychiropractic.com/schedule-appointment/appointment-thank-you-orlando/";
                        const messageHandler = function(event) {
                            if(event && event.data) {
                                const skedMessage = JSON.parse(event.data);
                                if(skedMessage && skedMessage.actionType === 'confirm') {
                                    window.location.href = redirectUrl;
                                }
                            }
                        };
    
                        window.addEventListener('message', messageHandler);
                    } catch(err) {};
                })();
            </script></div>
    <?php
        return ob_get_clean(); 
    }
    
    add_shortcode('sked_portal', 'sked_portal_shortcode');
    

    You can use this shortcode in Code Blocke element:

    [sked_portal]
    

    Please make sure to update the key value in this URL:

    https://portal.sked.life/new-patient?key=sfsfsdfsfssfds
    

    Best regards,
    Ismael

    #1468729
    This reply has been marked as private.
    #1468731

    Thank you, I tried this and I still am unable to save the page with the shortcode added instead of the embedded code. I also tried saving the page with the custom embedded code block completely removed and that didn’t work either.

    #1468762

    Hi,

    Thank you for the update.

    We saved the page content as a template, applied it to a temporary page, and removed the embedded code blocks. The issue does not occur on the temporary page. Please check the link in the private field.

    Best regards,
    Ismael

    #1468868

    Thank you, that did the trick

    #1468889

    Hi,

    Great! Glad to know that the issue has been resolved. Please feel free to create another thread if you have more questions about the theme.

    Have a nice day.

    Best regards,
    Ismael

Viewing 13 posts - 1 through 13 (of 13 total)
  • The topic ‘Errors when saving page edits – not a valid JSON response’ is closed to new replies.