Cornerstone "Frontend Error"

Hello Themeco!

I’ve been updating to the latest theme version across all my clients’ sites, and I’ve run into various degrees of Cornerstone issues. Some of them have a CDN (CloudFlare), but some of them don’t. It’s the worst on my own agency’s site: www.medinacom.com

Here is the exact error:

This error completely locks out any ability to edit all pages, both new and previously established. I’ve checked similar Cornerstone posts and taken a few steps:

• Cleared caches.
• Deactivated non-essential plugins.
• Checked for JS errors that could possibly break Cornerstone.

If we can pick apart why this is happening here, I should be able to remedy the error across the other sites.

I just got this error from the footer editor in Pro. After some digging and testing, I found out that when I enter the following into a text block the visual part of the editor fails and I get the same error notice.

<p>Copyright©<script type="text/javascript"> document.write(new Date().getFullYear()); </script> Company Name, All Rights Reserved.<br>Site Produced by <a href="https://domainname.com" target="_blank" title="additional info">Production Company Name</a></p>

When I remove the javascript for the date line that fixes the problem. Would love a work around so I can have my date stamp back. At least this is a possible answer to what you should look for.

Unfortunately I don’t even receive the opportunity to input anything; on a brand new created page, the “front end” conflict error still loads. I do have some custom code in sections of my site that are still in development, however.

When you put your inline script into the editor, did it break the entire site or just that particular page?

@medinacom, there are many causes to that. First, you might want to revert all your site to the previous working version. It is bad practice to update your live site without testing in a staging site. See https://theme.co/apex/forum/t/setup-updating-your-themes-and-plugins/62 for more details.

Once done, please test for the following:

  1. Ensure everything is up to date according to our version compatibility list at https://theme.co/apex/forum/t/troubleshooting-version-compatibility/195

  2. Clear all caches including browser cache then deactivate your caching plugins and other optimization plugins.

  3. If you’re using a CDN, please clear the CDN’s cache and disable optimization services.

  4. Test for a plugin conflict. You can do this by deactivating all third party plugins, and seeing if the problem remains. If it’s fixed, you’ll know a plugin caused the problem, and you can narrow down which one by reactivating them one at a time.

  5. Remove custom CSS, Javascript and templates.

@ACT_WebDev, not all scripts like in the case of document.write will work in the content so the safest solution here would be to use a shortcode. You can use a plugin like Shortcode for Current Date or you can build your own.

Thanks.

• Fixed.

The issue was somehow a result of an outdated (or broken) X child theme, which showed up when moving to the 5.1.1 version of X. I lost a few customizations, but nothing too crazy.

Regarding the topic of best practices: a three-page single-focus site that isn’t even optimized yet is hardly worth setting up a staging environment, but I suppose that is a debate for a different forum.

Hi Xian,
I actually thought of the shortcode thing this morning (when I was fresh and clear headed) and that worked great.

Update: Worked fine for 5 minutes. Then the visual editor only loaded 2017 up in the left hand corner of the preview window. As soon as I pulled the shortcode it snapped back to working correctly.

Hi @ACT_WebDev,

Would you mind opening another topic and link it here, then provide your login credentials in a secure note. If you can provide FTP credentials then that would help too. I like to personally check it and see what’s going on.

Though, you can try this

<p>Copyright© <span data-year="true"></span> Company Name, All Rights Reserved.<br>Site Produced by <a href="https://domainname.com" target="_blank" title="additional info">Production Company Name</a></p>

Then simply add this code to your global custom javascript

jQuery('[data-year="true"]').html( new Date().getFullYear() );

Thanks.

You Solved It! The visual preview loads now and comes back up when I quit out and reload the editor.
Thank you very much.
Blair

Thanks for letting us know!