Bug report: might be partly broken with php8.1
-
Hello!
I created here a support thread in the all-purpose “Fixing wordpress” forum, and I was told that might very well be specifically related to the “classic-widgets” plugin.
So, I’m making that report here too.I’m in the process of testing the migration of my hosting from php 7.4 to 8.1, as 7.4 isn’t maintained anymore, however I stumbled upon an issue I can’t quite figure out.
The environment:
Debian Buster. My panel (virtualmin) allows to choose which is the default PHP execution mode, but also to make exceptions (anything hosted in a directory of choice can run with a different version). PHP versions 7.4.33 (default) and 8.1.13 (testing).
I observed the bug I come to report in a brand new wordpress, installed on an empty directory with a freshly downloaded wordpress zip archive, using a brand new freshly created database. Only 1 plugin was added, Classic Widgets (to avoid the subjectively cumbersome block editing from the widgets management.)
I also observed it into the clone of an existing blog (cloned both files and database, wp-settings edited to change the site’s home url) that is still running fine in php 7.4 today, but in which there is the bug when ran in php 8.1.
The bug:
Saving the text contents of widgets only works when this is basic html content. (Think p, center.)
Anything more complex, a script, a form, or php, it won’t be saved. I click the “Save” button, a spinning wheel icon starts rotating left of the Save button… and nothing more happens. if I come back five actual minutes later to check, the button is still spinning, if I refresh the page, the change hasn’t been saved.
A screenshot: https://imgur.com/a/y3cWLmB
An example of the code that won’t be saved into a widget area, this is, plainly, a search form, no more, no less:
<div class="search_main"> <form method="get" class="searchform" action="/" autocomplete="off"> <input type="text" class="field s" name="s" value="Search..." onfocus="if (this.value == 'Search...') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Search...';}" autocomplete="off"> <button type="submit" class="fa fa-search submit" name="submit" value="Search"></button> </form> <div class="fix"></div> </div>
I tried with the “Classic widgets” plugin disabled , went to create a “Code” widget, pasted inside the code I quoted above, and it gave “There was an error. The response is not a valid JSON response.”. No idea if that’s the same issue or not, though.
I checked the website’s apache error log, without a risk of false positives as it was a test ground: nothing is recorded, at all, when I click the “Save” button and nothing happens.
… And at this point, I’m at my wit’s end.
TL;DR: code will be saved in php7.4, won’t be saved anymore in php 8.1, in otherwise identical setups.
Please, would anyone know what may be causing it, or how I may further debug it to find what may be causing it?
All help and suggestions will be more than welcome, thank you!
- The topic ‘Bug report: might be partly broken with php8.1’ is closed to new replies.