Fatal error caused by untitled column
-
I recently looked into a page that was truncating at the point of table display, and the associated chart data could not be edited in the admin interface due to an error.
I found this was caused by a column having an empty display header. It looks like the code is using the header name as a key, but in the case of an empty header, the key was empty.
PHP Warning: Undefined array key "" in /var/www/html/wp-content/plugins/wpdatatables/source/class.wpdatatable.php on line 1400This then triggers a fatal error in
prepareRenderingRules()stack trace below, although the line numbers are wrong because I’d added some error_log entries for debugging.PHP Fatal error: Uncaught Error: Call to a member function setFilterType() on false in /var/www/html/wp-content/plugins/wpdatatables/source/class.wpdatatable.php:2536
Stack trace:
#0 /var/www/html/wp-content/plugins/wpdatatables/source/class.wpdatatable.php(2514): WPDataTable->prepareRenderingRules()
#1 /var/www/html/wp-content/plugins/wpdatatables/source/class.wpdatatable.php(3092): WPDataTable->fillFromData()
#2 /var/www/html/wp-content/plugins/wpdatatables/source/class.wpdatachart.php(485): WPDataTable::loadWpDataTable()
#3 /var/www/html/wp-content/plugins/wpdatatables/source/class.wpdatachart.php(1024): WPDataChart->loadChildWPDataTable()
#4 /var/www/html/wp-content/plugins/wpdatatables/source/class.google.wpdatachart.php(388): WPDataChart->loadFromDB() ...I’d resolved the issue by manually adding column names using SQL
UPDATE wp_wpdatatables_columns SET orig_header="untitled" WHERE id=124;
UPDATE wp_wpdatatables_columns SET display_header="untitled" WHERE id=124;
The topic ‘Fatal error caused by untitled column’ is closed to new replies.