Skip to content

Conversation

jasonbahl
Copy link
Contributor

What does this implement/fix? Explain your changes.

This fixes a bug where an error would be displayed on the ACF Field Group if no ACF Options Pages were registered.

Does this close any currently open issues?

closes #82

Any relevant logs, error output, GraphiQL screenshots, etc?

Before

An error is displayed in the admin if no ACF Options Pages exist, but the field group is set to a location rule with "acf_option_pages === *"

CleanShot 2023-09-05 at 12 32 42@2x

After

No more error.

CleanShot 2023-09-05 at 12 30 22@2x

- add tests to ensure AcfOptionsPages show in the GraphQL Types only if there are ACF Options Pages registered to show in GraphQL
- introduce Utils::get_acf_options_pages()
- refactor uses of acf_get_options_pages() to use Utils::get_acf_options_pages()
@jasonbahl jasonbahl requested a review from markkelnar September 5, 2023 18:41
@jasonbahl jasonbahl self-assigned this Sep 5, 2023
@jasonbahl jasonbahl merged commit 9ca9521 into main Sep 5, 2023
@jasonbahl jasonbahl deleted the fix/#82-options-page-location-error branch January 24, 2024 20:04
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.

Warning: Undefined array key "AcfOptionsPage"
1 participant