impress-org / givewp

GiveWP - The #1 Donation Plugin for WordPress. Easily accept donations and fundraise using your WordPress website.
https://givewp.com/
GNU General Public License v3.0
346 stars 192 forks source link

Error message: Uncaught TypeError: array_shift(): Argument #1 ($array) must be of type array, bool given #6851

Closed joeczucha closed 1 year ago

joeczucha commented 1 year ago

Summary

Unable to edit pages through Wordpress dashboard due to plugin error

Details

An error of type E_ERROR was caused in line 106 of the file /var/www/html/oursite.com/app/public/content/plugins/give/src/MultiFormGoals/ProgressBar/Block.php. Error message: Uncaught TypeError: array_shift(): Argument #1 ($array) must be of type array, bool given in /var/www/html/oursite.com/app/public/content/plugins/give/src/MultiFormGoals/ProgressBar/Block.php:106
Stack trace:
#0 /var/www/html/oursite.com/app/public/content/plugins/give/src/MultiFormGoals/ProgressBar/Block.php(106): array_shift()
#1 [internal function]: Give\MultiFormGoals\ProgressBar\Block->localizeAssets()
#2 /var/www/html/oursite.com/app/public/content/plugins/give/src/Helpers/Hooks.php(43): call_user_func_array()
#3 /var/www/html/oursite.com/app/public/wordpress/wp-includes/class-wp-hook.php(308): Give\Helpers\Hooks::Give\Helpers\{closure}()
#4 /var/www/html/oursite.com/app/public/wordpress/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()
#5 /var/www/html/oursite.com/app/public/wordpress/wp-includes/plugin.php(517): WP_Hook->do_action()
#6 /var/www/html/oursite.com/app/public/wordpress/wp-admin/edit-form-blocks.php(272): do_action()
#7 /var/www/html/oursite.com/app/public/wordpress/wp-admin/post.php(187): require('...')
#8 {main}
  thrown

System Information

WordPress version 6.2.2 Active theme: Team Hope (version 0.1) Current plugin: Give - Donation Plugin (version 2.29.2) PHP version 8.2.7

Temporary fix

.. plugins/give/src/MultiFormGoals/ProgressBar/Blocks.php::106 CHANGED LINE 106 FROM     'editorColorPalette' => $editorColorPalette ? array_shift($editorColorPalette) : $defaultColorPalette, CHANGE LINE 106 TO     'editorColorPalette' => is_array($editorColorPalette) ? array_shift($editorColorPalette) : $defaultColorPalette,

JoshuaHungDinh commented 1 year ago

Hi @joeczucha, we appreciate your patience and for taking the time to submit a detailed report. We have submitted a PR https://github.com/impress-org/givewp/pull/6855 for this issue. Please let me know if you have any additional questions. Thanks!

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 14 additional days. Note, if this Issue is reporting a bug, please reach out to our support at https://givewp.com/support. If this is a feature request, please see our feedback board at feedback.givewp.com — that’s the best place to make feature requests, unless you’re providing a PR.

joeczucha commented 1 year ago

Thanks @JoshuaHungDinh, I look forward to it being merged.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 14 additional days. Note, if this Issue is reporting a bug, please reach out to our support at https://givewp.com/support. If this is a feature request, please see our feedback board at feedback.givewp.com — that’s the best place to make feature requests, unless you’re providing a PR.

joeczucha commented 1 year ago

Still relevant, I think.