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(wp5.9): taxonomy panel filter #149

Merged
merged 3 commits into from
Jan 12, 2022
Merged

Conversation

dkoo
Copy link
Contributor

@dkoo dkoo commented Jan 11, 2022

All Submissions:

Changes proposed in this Pull Request:

Looks like the props passed to the editor.PostTaxonomyType filter have changed in WP 5.9. It no longer passes a taxonomy prop containing info about the taxonomy, such as whether it's hierarchical or its human-readable labels. However, it does still pass the slug prop, which we can still use to determine whether the panel being rendered is for Categories or Tags. Relying on this slug prop alone should fix errors in WP 5.9 as well as maintain backwards compatibility with WP 5.8 and earlier.

Unrelated, but also adds the missing CHANGELOG.md file that will be needed for the new post-release CI job implemented in #141.

Fixes #148.

How to test the changes in this Pull Request:

  1. On master, edit a sponsor and attempt to expand the Categories or Tags sidebar panels.
  2. Observe an editor crash as described in "TypeError: taxonomy is undefined" error with WordPress 5.9 RC #148.
  3. Check out this branch rebuild, refresh, and confirm that the crash no longer happens and that you can once again add/remove categories and tags using both sidebar panels.

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@dkoo dkoo added bug Something isn't working [Status] Needs Review labels Jan 11, 2022
@dkoo dkoo requested a review from a team January 11, 2022 23:51
@dkoo dkoo self-assigned this Jan 11, 2022
@dkoo dkoo changed the title Fix/wp 5 9 taxonomy panel filter fix(wp5.9): taxonomy panel filter Jan 11, 2022
@laurelfulford laurelfulford self-requested a review January 12, 2022 04:49
Copy link
Contributor

@laurelfulford laurelfulford left a comment

Choose a reason for hiding this comment

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

You may want to have a more technical set of eyes check over this as well, but in my testing this PR fixed the issue and allowed me to load the editor and add/edit categories and tags using the 5.9 RC 2.

I also rolled my test site back to 5.8.3, I could still edit a sponsor and change the categories and tags with no issue. So it all looks good from a functional perspective! :)

@dkoo
Copy link
Contributor Author

dkoo commented Jan 12, 2022

The changes are pretty light from a logical perspective (it removes code instead of adding any), so I think we're good!

@dkoo dkoo merged commit 9a1fe03 into master Jan 12, 2022
@dkoo dkoo deleted the fix/wp-5-9-taxonomy-panel-filter branch January 12, 2022 16:32
matticbot pushed a commit that referenced this pull request Jan 13, 2022
# [1.8.0-alpha.1](v1.7.1...v1.8.0-alpha.1) (2022-01-13)

### Bug Fixes

* **wp5.9:** taxonomy panel filter ([#149](#149)) ([9a1fe03](9a1fe03))

### Features

* try enabling dependabot to keep dependencies up to date ([#74](#74)) ([e2d7458](e2d7458))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 1.8.0-alpha.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

matticbot pushed a commit that referenced this pull request Jan 19, 2022
# [1.8.0](v1.7.1...v1.8.0) (2022-01-19)

### Bug Fixes

* **wp5.9:** taxonomy panel filter ([#149](#149)) ([9a1fe03](9a1fe03))

### Features

* try enabling dependabot to keep dependencies up to date ([#74](#74)) ([e2d7458](e2d7458))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"TypeError: taxonomy is undefined" error with WordPress 5.9 RC
3 participants