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

Compatibility for PHP 8.2 #183

Closed
MichelleBlanchette opened this issue Sep 14, 2023 · 2 comments
Closed

Compatibility for PHP 8.2 #183

MichelleBlanchette opened this issue Sep 14, 2023 · 2 comments
Assignees
Labels
bug Something isn't working user request Reported by a user

Comments

@MichelleBlanchette
Copy link
Collaborator

Got another bug report related to submitting tasks via the Pinned Tasks metabox:

[14-Sep-2023 14:28:45 UTC] PHP Fatal error: Uncaught TypeError: array_sum(): Argument #1 ($array) must be of type array, bool given in /var/www/html/wp-content/plugins/completionist/src/includes/class-options.php:663
Stack trace:
#0 /var/www/html/wp-content/plugins/completionist/src/includes/class-options.php(663): array_sum(false)
#1 /var/www/html/wp-content/plugins/completionist/src/includes/class-asana-interface.php(1744): PTC_Completionist\Options::sanitize('date', '2023-09-18')
#2 /var/www/html/wp-content/plugins/completionist/src/admin/ajax/ajax-create-task.php(30): PTC_Completionist\Asana_Interface::create_task(Array)
#3 /var/www/html/wp-content/plugins/completionist/src/admin/class-admin-ajax.php(117): require_once('/nas/content/li...')
#4 /var/www/html/wp-includes/class-wp-hook.php(310): PTC_Completionist\Admin_Ajax::ajax_create_task('')
#5 /var/www/html/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters('', Array)
#6 /var/www/html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#7 /var/www/html/wp-admin/admin-ajax.php(188): do_action('wp_ajax_ptc_cre...')
#8 {main}
thrown in /var/www/html/wp-content/plugins/completionist/src/includes/class-options.php on line 663

The problem is using 0 === array_sum( $dt::getLastErrors() ) because PHP 8.2 allows that function to return a boolean if there's no errors.

So let's do some general testing with PHP 8.2 to check compatibility.

@MichelleBlanchette MichelleBlanchette added bug Something isn't working user request Reported by a user labels Sep 14, 2023
@MichelleBlanchette MichelleBlanchette self-assigned this Sep 14, 2023
@MichelleBlanchette
Copy link
Collaborator Author

The Asana SDK has compatibility issues per Asana/php-asana#118 but it doesn't seem to be causing functional issues. There's just a lot of Deprecated logs. Nothing I can really do about that anyways, though.

@MichelleBlanchette
Copy link
Collaborator Author

Fixed in f64bffa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working user request Reported by a user
Projects
None yet
Development

No branches or pull requests

1 participant