I'm getting this Error message. The theme cannot declare class because the name is already in use

Hello Team/ community! I’m getting this error in my plugin of cornerstone after the last update. any idea how to solve this?

An error of type E_ERROR was caused in line 8 of the file /var/www/wp-content/plugins/cornerstone/includes/classes/classic/utility/class-shortcode-preserver.php . `

I’d like assistance on the steps to fix it. I’m not confident reconfiguring FTP. Thanks in advance.

Hi Alex,

Thanks for reaching out!

In Cornerstone 6+ that file should be located here:

cornerstone/includes/classes/classic/elements/class-shortcode-preserver.php

But in the error above it claims to be here:

cornerstone/includes/classes/classic/utility/class-shortcode-preserver.php

I suspect what might have happened is the new files were added, but you still have the old files present in which case it would find both and crash like this.

Did you happen to update manually using FTP or a file manager? Often when updating that way it will replace existing files, and add files that don’t exist in the new locations but it doesn’t know to delete files that were relocated.

I would recommend fully deleting Cornerstone and reinstalling. A good way to do this would be:

  • Fully delete Cornerstone
  • Ensure X is on the latest version
  • Use the link provided by X in the dashboard to automatically install Cornerstone at the latest version.

Hope that helps and let us know how that goes.

YAY! This actually worked!

After a laundry list of errors with the update, I used a backup of my site, then after the backup I got the error in utilities files as seen above. Thanks for the help.

when updating X and Cornerstone, which should i update first?

Hello Alex,

You need to deactivate the Cornerstone plugin then update the X theme after updating the X theme you need to update the Cornerstone page builder plugin then activate it.

Hope it helps
Thanks

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