Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 8.X Error #166

Closed
slalabs opened this issue Apr 13, 2023 · 1 comment
Closed

PHP 8.X Error #166

slalabs opened this issue Apr 13, 2023 · 1 comment

Comments

@slalabs
Copy link

slalabs commented Apr 13, 2023

I get the following error on PHP 8, 8.1 and 8.2. With PHP 7.4 everything is fine. The snippets list does not load anymore, I get a blank page.

AH01071: Got error 'PHP message: PHP Fatal error: Uncaught TypeError: Unsupported operand types: string - string in /var/www//var/www/wordpress/wp-content/pluginscode-snippets-pro/php/class-list-table.php:1092\nStack trace:\n#0 /var/www//var/www/wordpress/wp-content/pluginscode-snippets-pro/php/class-list-table.php(1150): Code_Snippets\\List_Table->get_sort_direction()\n#1 [internal function]: Code_Snippets\\List_Table->usort_reorder_callback()\n#2 /var/www//var/www/wordpress/wp-content/pluginscode-snippets-pro/php/class-list-table.php(1055): usort()\n#3 /var/www//var/www/wordpress/wp-content/pluginscode-snippets-pro/php/admin-menus/class-manage-menu.php(118): Code_Snippets\\List_Table->prepare_items()\n#4 /var/www/wordpress/wp-includes/class-wp-hook.php(308): Code_Snippets\\Manage_Menu->load()\n#5 /var/www/wordpress/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()\n#6 /var/www/wordpress/wp-includes/plugin.php(517): WP_Hook->do_action()\n#7...', referer: https:/myblog.dev/wp-admin/admin.php?page=import-code-snippets&imported=50

@sheabunge
Copy link
Member

sheabunge commented Jun 19, 2023

Looks like this is an issue with the stricter type checking on newer PHP versions. Checking the type of both vars before running type-based comparisons should hopefully fix this.

Thank you for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants