Cornerstone causing a PHP Error

Hi!

I just inherited the administration of a website. My first task was to update Wordpress, X and Cornerstone to the latest stand, something I did today. However, every time I try to open any page to edit in Cornerstone, even when I try creating a new one, I get the well-known error message:

The preview could not load due to the iframe response being incomplete. This is most often related to a plugin conflict, or customizations introducing a PHP error.

Following your troubleshooting guide, I

  • deactivated all plug-ins except for cornerstone, and the problem persisted,
  • ensure the PHP memory limit was set at 512M,
  • checked my PHP version (it is 7.4.33), and
  • finally activated the PHP debug mode.

After the final step, I found the following lines in my error log:

PHP Notice:  Undefined variable: condition_text_decoration_is_line_through_or_underline in .../cornerstone/includes/config/theme-option-controls.php on line 83
PHP Notice:  Undefined variable: condition_text_decoration_is_underline in .../cornerstone/includes/config/theme-option-controls.php on line 85
PHP Notice:  Undefined variable: condition_text_decoration_is_line_through_or_underline in .../cornerstone/includes/config/theme-option-controls.php on line 86
PHP Notice:  Undefined variable: condition_text_decoration_is_line_through_or_underline in .../cornerstone/includes/config/theme-option-controls.php on line 87

I checked the affected file, theme-option-controls.php, and noticed that the conditions are indeed not defined in it. I compared this file to the similar file theme-option-standalone-controls.php, and noticed that the second one includes a block of definitions ate the beginning of the file, before the return [ command:

$condition_text_decoration_is_line_through_or_underline = [ 'key' => 'a_text_decoration_line', 'op' => 'IN', 'value' => ['line-through', 'underline'] ];
$condition_text_decoration_is_underline                 = [ 'key' => 'a_text_decoration_line', 'op' => 'IN', 'value' => ['underline']                 ];

I felt like those two lines are missing in the theme-option-controls.php file. So I went and added them. It did not fix the issue, I am still unable to edit any page and keep getting the same error message, but no more PHP errors are reported to my log.

Without errors in the log, I am unable to track the possible issue and ran out of ideas. I would love it if you could give me a hand here.

Thanks!

1 Like

Hi Rudy,

Thanks for reaching out.
The listed points are mostly PHP Notices and that can be ignored. It might be due to an improper update of the Cornerstone. I would suggest you updated the Cornerstone by following the below steps.

  1. Delete the existing Cornerstone.
  2. After deleting, use the link in the dashboard to automatically install the Cornerstone. It will be the latest version.

If that does not help, there might be some different reasons behind the problem you are facing. I would like to suggest troubleshooting the following common issue to help us to recognize the reason.

  1. Theme Related Issue
  2. Plugin Conflict
  3. Theme Update related issue
  4. CSS/JS Customization
  5. Disabling Cache
  6. Disabling CDN

If you discover that an issue is coming from a custom code or 3rd party plugin, kindly consult with a developer or contact the plugin author. Please note that we do not provide support for custom codes and 3rd party plugins.
If none of the above helps, please provide login credentials for your site in a secure note to examine it further, including:

– WordPress Site URL & Login URL
– WordPress Admin username/password

To create a secure note, click the key icon underneath any of your posts.

Thanks

Hi @tristup!

Thanks for your answer and the clarification regarding the PHP notices. I have uninstalled and installed Cornerstone a couple times, and the problem persists. (And the *.php file missing the lines is present in the zip I download after buying the license).

I have also tried all the debugging tricks suggested in your documentation, without success.

I just noticed that if I activate a theme different than X, I get cornerstone to work (although it does not load the site as I expect it, since it is applying the new theme). So the problem might be a conflict between my installation of X and that of cornerstone. I’ll double check that. But still, any extra help is much appreciated.

Regards,
Rudy

Good news: deleting and re-installing X fixed the problem. I still do not understand what I did wrong yesterday, but now things work well. Thanks a lot :slight_smile:

Hi Rudy,

It is good to know that the issue has now been resolved. Please don’t hesitate to create another thread if you need any other assistance.

Best Regards.

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