classifai icon indicating copy to clipboard operation
classifai copied to clipboard

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

Open iamdharmesh opened this issue 2 years ago • 0 comments

Describe the bug

During working on e2e using cypress PR(https://github.com/10up/classifai/pull/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

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

iamdharmesh avatar Apr 29 '22 11:04 iamdharmesh