Revisions Critical error on website

Hello,

After a recent wordpress update, my users started seeing error in the text when they visit the pressbooks sites. There would be a diamond with a question mark in a space in some pages and books. When they go to edit the page in the admin section. Nothing is shown in the edit box and when they try to view revisions, it says there is a “Critical error on website” box shown. The debug info says:

Fatal error: Uncaught TypeError: array_walk(): Argument #1 ($array) must be of type array, string given in …/wp-includes/Text/Diff/Engine/native.php:43 Stack trace: #0 …/wp-includes/Text/Diff/Engine/native.php(43): array_walk() #1 …/wp-includes/Text/Diff.php(55): Text_Diff_Engine_native->diff() #2 …/wp-includes/Text/Diff/Renderer/inline.php(167): Text_Diff->__construct() #3 …/wp-includes/Text/Diff/Renderer.php(170): Text_Diff_Renderer_inline->_changed() #4 …/wp-includes/Text/Diff/Renderer.php(143): Text_Diff_Renderer->_block() #5 /var/www/html/openbooks522.library.unt.edu/wp-includes/class-wp-text-diff-renderer-table.php(305): Text_Diff_Renderer->render() #6 …/wp-includes/Text/Diff/Renderer.php(170): WP_Text_Diff_Renderer_Table->_changed() #7 …/wp-includes/Text/Diff/Renderer.php(143): Text_Diff_Renderer->_block() #8 …/wp-includes/pluggable.php(3066): Text_Diff_Renderer->render() #9 …/wp-admin/includes/revision.php(120): wp_text_diff() #10 …/wp-admin/includes/revision.php(340): wp_get_revision_ui_diff() #11 …/wp-admin/revision.php(139): wp_prepare_revisions_for_js() #12 {main} thrown in …/wp-includes/Text/Diff/Engine/native.php on line 43
There has been a critical error on this website.

Has anyone experienced this or have a solution? I am running:
php 8.2
wordpress 6.61
pressbooks 6.19.2

thanks

1 Like

Greetings Jeremy,

At the moment, Pressbooks has not been tested for PHP 8.2, so you will get unpredictable results using it. From the error message though, it looks like more of a WordPress problem.

Can you please try downgrading to PHP 8.1 and see if you still get the same error?

Best,

Christopher

1 Like

Thanks for your help. I started with 8.0 and went to 8.2 from 8.1 trying to find the cause.

1 Like

Hi again Jeremy,

We have been unable to reproduce this locally, however when working on an unrelated task, one of our unit tests failed in a way that could be related to what might be causing your issue. We suspect something might have changed in WordPress that triggered this. We’ve made a slight change to address it and will be releasing it soon. Keep an eye out for our next release and let us know if this resolves it for you. I’ll also try to mention it here when the release is out.

Best,

Christopher

2 Likes

I have updated wordpress a few times and also pressbooks and we are still getting this error? My users are still reporting that they see these random diamonds on the screen and are unable to get to an edit page on journal web pages. We are on wordpress 6.6.2 and pressbooks 6.20.1. Are there any suggestions on updates or changes? thanks.