PHP fatal error with 3.0 upgrade
-
After upgrading TablePress to 3.0, first page reload apparently tries to convert existing tables/datatables from v1 to v2.
If/when
datatables_custom_commands
array key is missing, you’ll get aTypeError
fatal error during conversion, becauseTablePress::convert_datatables_api_data()
is expecting astring
, nut anull
value. This only happens once after plugin upgrade, but is reproducable, when pulling production data with TablePress 2.4.4 and upgrading to 3.0. This happens at least with PHP 8.3. Not sure about previous versions if they’re so strict about types.If you need more info, happy to provide.
Full error:
[21-Nov-2024 11:24:46 UTC] PHP Warning: Undefined array key "datatables_custom_commands" in /app/wordpress/wp-content/plugins/tablepress/models/model-table.php on line 1089
[21-Nov-2024 11:24:46 UTC] PHP Fatal error: Uncaught TypeError: TablePress::convert_datatables_api_data(): Argument #1 ($code) must be of type string, null given, called in /app/wordpress/wp-content/plugins/tablepress/models/model-table.php on line 1089 and defined in /app/wordpress/wp-content/plugins/tablepress/classes/class-tablepress.php:620
Stack trace:
#0 /app/wordpress/wp-content/plugins/tablepress/models/model-table.php(1089): TablePress::convert_datatables_api_data(NULL)
#1 /app/wordpress/wp-content/plugins/tablepress/classes/class-controller.php(123): TablePress_Table_Model->update_custom_commands_datatables_tp30()
#2 /app/wordpress/wp-content/plugins/tablepress/classes/class-controller.php(31): TablePress_Controller->plugin_update_check()
#3 /app/wordpress/wp-content/plugins/tablepress/controllers/controller-admin.php(54): TablePress_Controller->__construct()
#4 /app/wordpress/wp-content/plugins/tablepress/classes/class-tablepress.php(228): TablePress_Admin_Controller->__construct(NULL)
#5 /app/wordpress/wp-content/plugins/tablepress/classes/class-tablepress.php(281): TablePress::load_class('TablePress_Admi...', 'controller-admi...', 'controllers')
#6 /app/wordpress/wp-content/plugins/tablepress/classes/class-tablepress.php(159): TablePress::load_controller('admin')
#7 /app/wordpress/wp-includes/class-wp-hook.php(324): TablePress::run('')
#8 /app/wordpress/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
#9 /app/wordpress/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#10 /app/wordpress/wp-settings.php(704): do_action('init')
#11 /app/wordpress/wp-config.php(152): require_once('/app/wordpress/...')
#12 /app/wordpress/wp-load.php(50): require_once('/app/wordpress/...')
#13 /app/wordpress/wp-admin/admin.php(34): require_once('/app/wordpress/...')
#14 /app/wordpress/wp-admin/index.php(10): require_once('/app/wordpress/...')
#15 {main}
thrown in /app/wordpress/wp-content/plugins/tablepress/classes/class-tablepress.php on line 620
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- You must be logged in to reply to this topic.