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

Filtering Idea's with default status or multiple tags returns inaccurate results #7907

Closed
cchabilall83 opened this issue Oct 9, 2018 · 1 comment
Labels
Type: Bug A clear defect in a feature that has been shipped. Fix should include automated testing if possible.

Comments

@cchabilall83
Copy link
Contributor

cchabilall83 commented Oct 9, 2018

Issue
If an idea has more than one tag, or is created with a default status, filter by status will return inaccurate results.

Details
This was notice when trying to filter idea's by 'Active' status. An idea created is with a default status of 'active' or tag id 15. In the ideation plugin an ' , ' is appended to the tag id and then saved in the Discussion table (tags column) as ' 15, ' . If we try to filter idea's by status, the queries used in the discussion model (getCount, getWhereRecent) use the following condition where d.Tags = 15. This returns only Ideas with a tag of 15 and ignoring those with '15,'. If an idea has another tag (ie. 15, 100) it is ignored as well.

This is where we apply tags on an idea:

https://github.com/vanilla/internal/blob/e1fc8f27bb0fa679fa6778c9895dd89eceb4824c/plugins/ideation/class.ideation.plugin.php#L524

This is the query that's broken:

https://github.com/vanilla/vanilla/blob/master/applications/vanilla/controllers/class.categoriescontroller.php#L455

Other Information

  • Creating an idea, then editing it and adding a tag overwrites the status tag.
  • Not sure if filtering by tags is broken elsewhere.

Possible Solution

Tags is a string so we have to have to find a way to apply a default tag without a following "," . We also have to be able to append following tags.

@cchabilall83 cchabilall83 changed the title Filtering Idea's with multiple tags returns inaccurate results Filtering Idea's with default status or multiple tags returns inaccurate results Nov 29, 2018
@cchabilall83
Copy link
Contributor Author

I've been able to narrow down a fix but altering our discussionModel::getwhere query and join on the Tag_Discussion table on the category id and tag id.

@cchabilall83 cchabilall83 added the Type: Bug A clear defect in a feature that has been shipped. Fix should include automated testing if possible. label Mar 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug A clear defect in a feature that has been shipped. Fix should include automated testing if possible.
Projects
None yet
Development

No branches or pull requests

2 participants