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
- Go to
ClassifAI > Language Processing and setup API credentials
- Enable All features (category, keywords, etc...) and assign related Watson taxonomy to each feature.
- Create a post and note the terms created in each taxonomy.
- Go to Language Processing settings and update "Tag" as a taxonomy for each feature.
- 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 |
 |
 |
Environment information
No response
WordPress information
No response
Code of Conduct
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_termsoverwrites terms/tags linked by other featureshttps://github.com/10up/classifai/blob/develop/includes/Classifai/Watson/Linker.php#L116.
Steps to Reproduce
ClassifAI>Language Processingand setup API credentialsScreenshots, screen recording, code snippet
Environment information
No response
WordPress information
No response
Code of Conduct