Cornerstone editor error - Cannot read property 'substr' of undefined

Wordpress version 4.9.7
X version 6.1.6
Cornerstone version 3.1.6

Editing any page with cornerstone fails to load. The console has this error twice:
cs-body.js?ver=3.1.6:1 Uncaught TypeError: Cannot read property 'substr' of undefined at cs-body.js?ver=3.1.6:1

That error is coming from a cornerstone file. I don’t believe this is the result of a plugin conflict, but I’m testing that now just to be sure.

Update: It’s not a plugin conflict. I disabled all plugins except cornerstone and the same error is coming up. Here is a screenshot of the console.

It looks as if the content of the page might be screwing up loading the editor, which shouldn’t be possible of course.

Another update: Another page which has no content tag warnings is also getting the cannot read property ‘substr’ of undefined error, so it’s not that. It also loads the editor after getting that error, so I’m thinking the reason I can’t edit the problematic page has nothing to do with this substr error.

Hi There @archonic

Thanks for writing in! Could you please try re-installing your X theme and Cornerstone plugin, so that it will fix any corrupted or missing dependency files in on your site.

First disable and delete your Cornerstone plugin. Then head over to Appearance -> Themes section and switch to a default WordPress theme and then you can delete X theme as well. Now you can download the latest X theme from your Envato account and install it as you would normally do via Appearance -> Themes section.

Head over to X -> Validation section and wait for few seconds to install the latest version of Cornerstone plugin automatically.

Finally head over to X -> Settings area and set the permissions to edit your pages/posts and try loading your Cornerstone editor.

Note: All the existing settings will be saved in the database, so that you can safely delete X theme and Cornerstone plugin.

Let us know how it goes.
Thanks!

Thanks for the speedy reply @mldarshana but that’s just a shot in the dark. It turned out this issue was a conflict with a modification I made to load a 3rd party booking form. Previously I was using
if ( !(isset($_GET['cornerstone_preview']) && !empty($_GET['cornerstone_preview'])) ) { ... }

To make sure it didn’t load the script which installs an iframe when editing. The editing URL changed and that caused the issue I saw.

Now I’m trying to get Tabs working because that also broke with the X upgrade. Does the ThemeCo team have no regard for backwards compatibility? The experience with X and Cornerstone has been a real mess for existing customers. Most people don’t care about the updates and just want their site to continue working.

Hi,

The tab issue was fixed in V6.1.6

https://theme.co/changelog/

Please take note of the following when updating

  1. After the updating, please make sure to clear your plugin cache, browser cache and system’s cache(under X> settings).
    If you have CDN, plesae clear your CDN cache as well.

It’s possible to implement an update, and not have it take place because a cached version of the page or various resources are loading instead of the latest version.

  1. We always recommend creating a staging site and doing the update first in your staging . After checking that everything is working, that is the only time to do the update in your live site.

You can use this third party plugin to create a staging site.

  1. It is also recommended that before doing the update, you create a full back up of your site first. That way if anything goes wrong you can roll back your site easily.

You can use this third party plugin to create a backup

Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.