Options->Discussions unchecked Checkboxes issue?
-
I get the feeling that there is a serious issue with the wp-admin/options.php code.
The page cannot uncheck checkboxes, they remain checked after save.In debug mode I see the following errors, when I click on save at the settings discussion page.
“Error while executing query! …. constraint failed: wp_options.option_value”
Digging into the code and the http post I see the following:
– in options.php there is a whitlist “whitelist_options”. If the key value pair is not set via POST at the config page the value is set to the default value null.
– second, the value of an unchecked checkbox in HTML is not sent via POST
That leads to the problem that certain unchecked boxes in the options page lead by default to a database constraint error because there is a contraint in the table
option_value
longtext NOT NULL,I resolved the bug by changing the default value to 0 in options.php
$value = 0;
A better solution is this but requires more changes in the backend code
https://trickspanda.com/set-value-unchecked-checkboxI got these errors on the boxes:
comments_notify
comment_moderation
close_comments_for_old_posts
page_comments
show_comments_cookies_opt_inThis is either a fundamental bug in the config or I’m too stupid to understand the functionality behind.
regards,
ThomasWordpress version 5.3.2
- The topic ‘Options->Discussions unchecked Checkboxes issue?’ is closed to new replies.