Javascript error when attempting to edit a page.

ces55739's Avatar

ces55739

21 Oct, 2014 03:01 PM

Hello,

On the view tab of a page, there is an image of a 'pencil' that appears on a viewable page. When you click on it, it links to editing the page. We have been using this feature for quite a while, however it stopped working.

We receive this Javascript error when we click on the 'pencil':

Uncaught ReferenceError: openRegionInlineEdit is not defined

Any thoughts or suggestions are appreciated, thanks!

  1. 1 Posted by Ryan Griffith on 21 Oct, 2014 03:19 PM

    Ryan Griffith's Avatar

    Hi,

    I think I may have seen this recently. Can you verify if any of the Templates used within your page's configuration have changed around the time you started experiencing this behavior? When you have a moment, please attach the XML for these Templates(s) so I can take a closer look.

    Also, I have a few additional questions to see if we can narrow things down a bit more:

    • What version of Cascade Server are you experiencing this behavior in?
    • Did you recently upgrade? If so from what version?
    • Are you experiencing this behavior in a specific browser, or multiple browsers?

    Please let me know if you have any questions.

    Thanks!

  2. 2 Posted by ces55739 on 21 Oct, 2014 07:52 PM

    ces55739's Avatar

    We modified our Basic template to have additional regions which included formats with PHP code ( using php passthrough tags). That way we could modify the heading on all of our pages without having to republish every page.

    I attached our template file.

     -- Cascade Server v7.12.2
     -- We haven't upgraded recently.
     -- The error occurs in both Chrome and Firefox. I didn't bother trying other browsers.

    Thanks!

  3. 3 Posted by Ryan Griffith on 22 Oct, 2014 01:02 PM

    Ryan Griffith's Avatar

    Hi,

    Thank you for providing your Template code and additional information.

    After taking a look at your Template, I have confirmed the behavior you are experiencing is due to the <head> tag not being within the Template itself, but is instead generated within a region. While this is completely valid in terms of XML structure, the issue is when the in-context editing code is added to the page view. When the page view process begins, it looks at the Template for a <head> element so it can inject a <script> tag within it. In your case, the in-context script is never loaded because there is no <head> at that point in the page render process, it is being rendered later via the HEAD region. This is why you are experiencing the JavaScript error when you try to click the icon.

    This functionality has been around for quite some time, so I suspect you may have recently moved the <head> tag into that HEAD region. The best workaround would be to move the <head> tag into the Template and relocate your HEAD region within it. This will still allow you to re-use the code, only it will not contain that outer tag.

    <html class="no-js"><!--<![endif]-->
    <head>
    <system-region name="HEAD"/>
    </head>
    <body>
    ...
    </body>
    </html>
    

    Please let me know if you have any questions.

    Thanks!

  4. 4 Posted by ces55739 on 23 Oct, 2014 02:33 PM

    ces55739's Avatar

    That seemed to do the trick!

    Thanks for the wonderful explanation.

  5. 5 Posted by Ryan Griffith on 23 Oct, 2014 05:45 PM

    Ryan Griffith's Avatar

    Thank you for following up. I am glad to hear that did the trick, and, my apologies for the inconvenience there.

    I'm going to go ahead and close this discussion, please feel free to comment or reply to re-open if you have any additional questions.

    Have a great day!

  6. Ryan Griffith closed this discussion on 23 Oct, 2014 05:45 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac