Cornerstone content page giving PHP error

I have a website where one page is causing a PHP error and showing a “Fatal Error”. The page is “https://aiapa.org/special-awards/

All other pages seem to be operating normally. This page cannot be viewed on the front end or opened in either Cornerstone or through the WP dashboard. Clicking on it in Cornerstone gives an error (screenshot attached), and the WP dashboard throws the same Fatal Error as the front end.

The text of the error is a big long stack trace pointing at line 8 in pro/cornerstone/includes/classes/Tss/Typed/Number.php

The full stack trace is here: https://pastebin.com/2d9eyKQS
Password is: krw37EPbHp
(Note I have disabled the verbose errors because it was causing other issues so the only thing visible at the moment is the normal WP error page.)

For what it’s worth, a little tracing and some ChatGPT troubleshooting (I know… I know…) and a temporary solution seems to be to change Number.php’s unaryPlus function to handle incorrect types.

Original:
// public function unaryPlus() {
// return $this->setValue(abs($this->value));
// }

Fixed:
public function unaryPlus() {
if (!is_numeric($this->value)) {
$this->value = 0; // Set value to 0 - optionally you could do something else here.
}
return $this->setValue(abs((float)$this->value));
}

Hi Marie,

Thanks for reaching out.

Although it is showing an error with the theme file, it seems that there might be some different reasons behind your issue. 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.Child Theme Related issue

5.CSS/JS Customization

6.Disabling Cache

7.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 that does not help, 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

While I appreciate that this needs to be the default response, I believe the stack trace I pointed to suggests that this is a potential bug in how Pro/Cornerstone handles malformed data, rather than something related to other plugins, custom code, or WP core.

  1. Specific Files and Classes : The trace mentions classes like Themeco\Cornerstone\Tss\Typed\Number , and Themeco\Cornerstone\Tss\Evaluator , all of which are part of the Pro theme’s Cornerstone framework. This indicates that the theme’s own scripts and operations are at the heart of the issue.
  2. Theme Operations : Functions such as unaryPlus() , operations like DefineList and DefineCommaList , and classes like Tss\Evaluator suggest that the theme is performing operations related to template and style setup (I don’t know what TSS is but maybe Themeco Style Sheet or Template Style Sheet?).
  3. Lack of External Plugins : None of the paths in the stack trace explicitly reference external plugins, child theme files, or WordPress core files outside of the theme directory. While it’s possible that data from plugins or external sources could be processed through these theme functions (e.g., via hooks or filters), the trace doesn’t directly indicate involvement from other plugins, which I would expect if they were at issue.
  4. Data Flow : The nature of the operations (like handling unary operations on numbers and evaluating expressions) suggests that the error may arise from how dynamic content or settings are processed within the theme.

The fact that the issue was resolved by simply doing a type-check on the unaryPlus() function further suggests it’s just a minor theme code issue you could patch in the next release so I don’t need to write a function to override unaryPlus() in my child theme.

Hello Marie,

Glad that you were able to resolve your issue by yourself.

Thanks

I don’t think we’re having the same conversation. Yes, I have resolved the immediate issue by modifying the code in Pro. This will not survive regular Pro updates. And the potential bug of unaryPlus() being unable to handle mistyped data remains in the main Pro code.

I need to know if you are able to push this into the update pipeline or if I need to try to write a more permanent fix in the child theme.

This is probably a question to elevate to the theme devs. Thanks.

Hi Marie,

You are correct here. The Pro update will override the code you have written and may generate the same issue again. As I have already investigated the same and was unable to reproduce the issue, I requested you go through the common issue troubleshooting to recognize the cause of it.
If you have already gone through those, I would suggest you please copy your live site to a staging server and remove the code you updated and give us access in the secure note including for further investigation:

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

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

Thanks

I have moved the site to a local staging (online staging is unavailable at this time) and the error is not recurring there. Is it possible that the issue truly was just corrupted page data that fixed itself when I ran the patched code and it’s no longer needed?

Hello @lpcmlinnevonberg,

It might be the issue of cache, PHP version, or corrupted data issue.

Thanks

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