PHP Error after Updates

Hi there

after updating all Plugins, X-Theme and Cornerstone, the home-page of my website had a fatal display error. In Cornerstone Builder, the start-page could not be displayed anymore and it seems to be a plugin-conflict or a error in the functions PHP file. I have deaktivated all plugins and the error was still there. I have checked the functions PHP file and when saving this file the following error appears:

Deine PHP-Code-Änderungen wurden aufgrund eines Fehlers in Zeile 86 der Datei wp-content/themes/x-child/functions.php zurückgesetzt. Bitte beheben und versuchen, erneut zu speichern.

Uncaught Error: Call to undefined function cs_get_raw_excerpt() in wp-content/themes/x-child/functions.php:86
Stack trace:
#0 wp-includes/shortcodes.php(343): x_shortcode_recent_posts_v2code(Array, ‘’, ‘x_recent_posts’)
#1 [internal function]: do_shortcode_tag(Array)
#2 wp-includes/shortcodes.php(218): preg_replace_callback(’/\[(\[?)(x_audi…’, ‘do_shortcode_ta…’, ‘\n<div class="e1…’)
#3 wp-includes/class-wp-hook.php(292): do_shortcode(’\n<div class="e1…’)
#4 wp-includes/plugin.php(212): WP_Hook->apply_filters(’\n<div class="e1…’, Array)
#5 wp-content/plugins/cornerstone/includes/utility/helpers.php(98): apply_filters(‘cs_expand_conte…’, ‘\n<div class="e1…’)
#6 wp-content/plugins/cornerstone/includes/elements/helpers.php(70): cs_expand_content(’\n<div class="e1…’)
#7 /home/tuccil

The code in line 86 looks like this:
$excerpt = ( $show_excerpt ) ? ‘

’ . preg_replace(’/<a.?more-link.?</a>/’, ‘’, cs_get_raw_excerpt() ) . ‘

’ : ‘’;

Is there any possibility, to find the error in the code with this information? The page worked fine with the same code before updating Plugins, X-Theme and Cornerstone.

Thank you very much for your help!

Hi Felix,

Thanks for reaching out.
As per the Error description, it seems that the issue is with some code that is written in the Child Theme, I would suggest you activating the parent theme and check if that resolved the issue. If that is resolved, the child theme has some erroneous code, which is the reason behind your issue.
Please remember that we don’t offer any support to custom codes and modified child themes too.

If the issue does not resolve after activating the parent theme, 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

Thank you very much for your reply. The error comes from the code in the functions.php file. Before updating the Theme, Plugins etc. the code in the functions.php worked well.

Any idea, what could be the problem?

Thank you very much for your help!

Hi Felix,

It will be very difficult to say anything about the error you have mentioned earlier, but it seems that method cs_get_raw_excerpt you have used is deprecated now. I would suggest you to go through the following thread with similar topic which may help you to recognize the reason.


Thanks

Hi Tristup

Thank you very much for your reply and for sending me the links to the thread.

I have restored the website with a earlier backup before I did the Updates. After restoring, the page worked perfect again. I was able to update WordPress, X-Theme, and all Plugins to the latest version. Except Cornerstone Builder. When I updated Cornerstone Plugin,the same error happend again.

If I remove all code in functions.php, the page works also with the latest updated Cornerstone, but it has some display missmatches on the homepage, which are normally repaired by the functions.php code. So this is, why I need the functions.php code as it is.

There must be a conflict between the letest Cornerstone version and this functions.php code.

At the moment, I run this website with Cornerstone version 4.2.3 and everything is ok. But I think, at some point I have to update Cornerstone as well, ant then I will have the same problem.

Here I send you the full functions.php code, which has the conflict wit Cornerstone version 5.3.3.

Maybe you can find a solution for this problem?

Thank you very much for your help!

Hi Felix,

In the given thread, my colleague has clearly mentioned that the cs_get_raw_excerpt method you are using is deprecated and not in use anymore. You need to replace that function with the cs_trim_excerpt_for_social.

Please remember that we don’t troubleshoot any custom codes and don’t offer any support to the modified child theme.

Thanks

Hi Tristp

Thank you so much for your great help! Replacing the function solved the problem!

Thanks again for your great support!

Hello Felix,

Glad that we were able to help you. Please feel free to reach us if have any more query regarding our theme and theme settings.

Have a great day!
Thanks

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