PurpleTurtleCreative / completionist

Asana integration plugin for WordPress.
https://purpleturtlecreative.com/completionist/
GNU General Public License v3.0
1 stars 0 forks source link

Compatibility for PHP 8.2 #183

Closed MichelleBlanchette closed 11 months ago

MichelleBlanchette commented 11 months ago

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 commented 11 months ago

The Asana SDK has compatibility issues per https://github.com/Asana/php-asana/issues/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 commented 11 months ago

Fixed in f64bffaca18161bdf22c5baed4f3a2cf54a446af