Skip to content

Fix/author list roles and exclusion #2166

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

Merged
merged 3 commits into from
Jul 17, 2025

Conversation

leogermani
Copy link
Contributor

@leogermani leogermani commented Jul 16, 2025

All Submissions:

Changes proposed in this Pull Request:

Fixes two issues in the Author List plugin

  • It doesn't properly filter custom roles
  • Exclude authors (cherry picking author names) is not working

How to test the changes in this Pull Request:

  1. You can test this with any custom role, like the ones added by Yoast or Woocommerce
  2. Make sure you have authors in one of those custom roles
  3. Test feat: add support for guest contributor in author list block newspack-plugin#4090
  4. Add an Author List block and filter by that role
  5. Confirm it works as expected
  6. Test excluding one of the visible authors
  7. Confirm they are correctly excludeed

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?

@rbcorrales
Copy link
Member

I tested this with the custom "Shop manager" role and after checking out the branch, it's showing the user after selecting that role.

However, I'm not sure if this needs additional changes, because if I try to exclude that specific user with the custom role searching by name, it never gets listed (the /wp-json/newspack-blocks/v1/authors?search=customer&offset=0&fields=id%2Cname&_locale=user XHR call returns an empty array):

image

@leogermani
Copy link
Contributor Author

Thanks @rbcorrales , you found another bug.

It led me to a small refactor, but I think things look better now. Please test again (need to update the other plugin branch as well).

And can I ask you to test something else? It's important that we ensure that previous instances of the block are not affected. So create a few blocks in trunk and then apply this branch.

In my testing, some weird things happen when you try to edit the block... it will get in a broken state. BUT it will work as usual if you don't touch them, which I think is good enough

Copy link
Member

@rbcorrales rbcorrales left a comment

Choose a reason for hiding this comment

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

The latest version works. Thanks for addressing this!

@leogermani leogermani merged commit f2dfe4d into trunk Jul 17, 2025
8 checks passed
@leogermani leogermani deleted the fix/author-list-roles-and-exclusion branch July 17, 2025 20:10
Copy link

Hey @leogermani, good job getting this PR merged! 🎉

Now, the needs-changelog label has been added to it.

Please check if this PR needs to be included in the "Upcoming Changes" and "Release Notes" doc. If it doesn't, simply remove the label.

If it does, please add an entry to our shared document, with screenshots and testing instructions if applicable, then remove the label.

Thank you! ❤️

matticbot pushed a commit that referenced this pull request Jul 17, 2025
## [4.14.6-alpha.1](v4.14.5...v4.14.6-alpha.1) (2025-07-17)

### Bug Fixes

* Fix/author list roles and exclusion ([#2166](#2166)) ([f2dfe4d](f2dfe4d))
@matticbot
Copy link
Contributor

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

The release is available on:

Your semantic-release bot 📦🚀

matticbot pushed a commit that referenced this pull request Jul 28, 2025
## [4.14.6](v4.14.5...v4.14.6) (2025-07-28)

### Bug Fixes

* Fix/author list roles and exclusion ([#2166](#2166)) ([f2dfe4d](f2dfe4d))
* remove current page deduplication from logic when deduplication is disabled ([#2169](#2169)) ([4000d85](4000d85))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 4.14.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

3 participants