Filtering Idea's with default status or multiple tags returns inaccurate results #7907
Labels
Type: Bug
A clear defect in a feature that has been shipped. Fix should include automated testing if possible.
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
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.
The text was updated successfully, but these errors were encountered: