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: Taxonomy field returns incorrect data if set to store objects instead of IDs #178

Merged

Conversation

jasonbahl
Copy link
Contributor

What does this implement/fix? Explain your changes.

When an ACF Field of the "Taxonomy" type field is set to store objects instead of IDs:

CleanShot 2024-02-20 at 09 45 36

The resolver returns incorrect information. This resolves that by accounting for IDs or Objects being stored and returned.

Does this close any currently open issues?

closes #177

Any other comments?

(see issue #177 for the scenario)

With the following term saved in the "rubrique" field:

CleanShot 2024-02-20 at 09 46 54

Before:

The "Uncategorized" term is resolved (not expected behavior)

CleanShot 2024-02-20 at 09 48 03

After:

The expected term is resolved:

CleanShot 2024-02-20 at 09 47 07

…esolver returns incorrect information. This resolves that by accounting for IDs or Objects being stored and returned.
…taxonomy-field-not-handling-objects-properly
@jasonbahl jasonbahl self-assigned this Feb 20, 2024
…ect vs id & array vs individual value)

- add test for Taxonomy field when 'object' is set as the return type
@coveralls
Copy link

coveralls commented Feb 20, 2024

Pull Request Test Coverage Report for Build 6b5ba619b0caedb22501d15572c6ba5c41d692fa-PR-178

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • -2 of 17 (88.24%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.05%) to 62.466%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/FieldType/Taxonomy.php 15 17 88.24%
Totals Coverage Status
Change from base Build cd6404a205bd92262a8099dcc3ed138614c6d080: 0.05%
Covered Lines: 2037
Relevant Lines: 3261

💛 - Coveralls

@jasonbahl jasonbahl merged commit d734a3e into develop Feb 20, 2024
25 checks passed
@jasonbahl jasonbahl mentioned this pull request Feb 20, 2024
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.

Taxonomy field is resolving Category terms instead of custom taxonomy terms
2 participants