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

Fix: Handle boolean values from get_theme_support in MultiFormGoal/ProgressBar #6855

Merged

Conversation

JoshuaHungDinh
Copy link
Contributor

@JoshuaHungDinh JoshuaHungDinh commented Jul 24, 2023

Resolves #6851

Description

It is possible that 'get_theme_support' returns a false value if explicitly defined in a theme.

If $editorColorPalette is a boolean (either true or false), attempting to use array_shift() on it will result in a type error.

Affects

Multi Form Goal Progress Bar

Testing Instructions

  • Switch to PHP 8+
  • Use a theme that defines add_theme_support('editor-color-palette', false);
  • Add the MultiFormGoal block

Pre-review Checklist

  • Acceptance criteria satisfied and marked in related issue
  • Relevant @unreleased tags included in DocBlocks
  • Includes unit tests
  • Reviewed by the designer (if follows a design)
  • Self Review of code and UX completed

Copy link
Contributor

@jonwaldstein jonwaldstein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JoshuaHungDinh thanks for adding this, please send to QA

@kjohnson
Copy link
Member

Following up - has this change been through QA?

@JoshuaHungDinh
Copy link
Contributor Author

@kjohnson, Yes but another cooldown item regarding a different issue with the multiformgoal block is keeping QA from being able to manually test it. I checked it out and believe its in regards to react-select in the block editor. We can add react and react-dom to the webpack externals which will fix it. I was hesitant though as I was not sure if it would introduce any breaking changes and so the item is sitting in a deferred status at the moment. Here a link to the additional issue : https://feedback.givewp.com/bug-reports/p/forms-cannot-be-selected-in-multi-form-goal-block

@kjohnson
Copy link
Member

@JoshuaHungDinh that works for me! And of course now I see the Asana link in the PR description - whoops!

Adding a link to the QA comment for cross-reference: https://app.asana.com/0/0/1205176602055571/1205204829262848/f

@joeczucha
Copy link

Just checking whether this was ever merged, as were holding off updating the plugin until there is a fix in place. Thanks

@JoshuaHungDinh
Copy link
Contributor Author

@joeczucha, thanks for checking in. We have another developer integrating some changes to id filtering for this particular block in order for it to properly work. We expect to have those updates soon & once merged this PR can follow

I will be sure to reach out once this issue has been resolved.

Copy link
Member

@rickalday rickalday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passed manual QA tests

@JasonTheAdams JasonTheAdams merged commit eba4d05 into develop Oct 25, 2023
20 checks passed
@JasonTheAdams JasonTheAdams deleted the fix/handle-multi-form-goal-progressbar-color-palette branch October 25, 2023 22:22
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

Successfully merging this pull request may close these issues.

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