Automattic / HyperDB

HyperDB is an advanced database class that supports replication, failover, load balancing, and partitioning.
103 stars 22 forks source link

PHP 8.1.9 Fatal error on saving changes in Discussion/Media settings #74

Open katladyj opened 2 years ago

katladyj commented 2 years ago

I am testing HyperDB with a fresh install of WordPress 6.0.2 on Apache+php 8.1.9. Clicking "Save Changes" on the Discussion/Media Settings pages in the dashboard returns the critical error notice page. This occurs even if no options were selected to be changed. The other settings pages don't return this error.

Log for Discussion Settings:

AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught mysqli_sql_exception: Column 'option_value' cannot be null in /www/wp-content/db.php:1404
Stack trace:
#0 /www/wp-content/db.php(1404): mysqli_query()
#1 /www/wp-content/db.php(942): hyperdb->ex_mysql_query()
#2 /www/wp-includes/wp-db.php(2476): hyperdb->query()
#3 /www/wp-includes/option.php(496): wpdb->update()
#4 /www/wp-admin/options.php(322): update_option()
#5 {main}
  thrown in /www/wp-content/db.php on line 1404', referer: https://host.url/wp-admin/options-discussion.php

Log for Media Settings:

AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught mysqli_sql_exception: Column 'option_value' cannot be null in /www/wp-content/db.php:1404
Stack trace:
#0 /www/wp-content/db.php(1404): mysqli_query()
#1 /www/wp-content/db.php(942): hyperdb->ex_mysql_query()
#2 /www/wp-includes/wp-db.php(2476): hyperdb->query()
#3 /www/wp-includes/option.php(496): wpdb->update()
#4 /www/wp-admin/options.php(322): update_option()
#5 {main}
  thrown in /www/wp-content/db.php on line 1404', referer: https://host.url/wp-admin/options-media.php
dd32 commented 2 years ago

I believe this was fixed via #41 + #42, but the version of HyperDB you likely installed from the plugin directory didn't have those fixes yet.