Skip to content

Terms/Tags are not getting created correctly when we select common taxonomy between enabled features. #340

@iamdharmesh

Description

@iamdharmesh

Describe the bug

During working on e2e using cypress PR(#334), I noticed that when we select common taxonomy between enabled features, then terms/tags are not getting created correctly. Created terms/tags are not the combinations of the terms of the selected features instead it gets overwritten and ended up creating terms/tags of the only one feature. Please check screenshots for more information.

Based on the initial investigation this is happening because wp_set_object_terms overwrites terms/tags linked by other features
https://github.com/10up/classifai/blob/develop/includes/Classifai/Watson/Linker.php#L116.

Steps to Reproduce

  1. Go to ClassifAI > Language Processing and setup API credentials
  2. Enable All features (category, keywords, etc...) and assign related Watson taxonomy to each feature.
  3. Create a post and note the terms created in each taxonomy.
  4. Go to Language Processing settings and update "Tag" as a taxonomy for each feature.
  5. Update a post created in step 3, check created tags. Created tags should be a combination of all terms created in step 3, but only a few tags are getting created.

Screenshots, screen recording, code snippet

Separate taxonomy for each features Common taxonomy between features
image image

Environment information

No response

WordPress information

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

Labels

help wantedExtra attention is needed

Type

No type
No fields configured for issues without a type.

Projects

Status

No status

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions