[CONTTAGS-58] TagManager can return wrong result set when searching multiple tags Created: 16/Feb/18  Updated: 04/Jan/21  Resolved: 28/Oct/20

Status: Closed
Project: Content Tags
Component/s: None
Affects Version/s: 2.0.1
Fix Version/s: 2.0.2

Type: Bug Priority: Neutral
Reporter: Richard Gange Assignee: Federico Grilli
Resolution: Fixed Votes: 0
Labels: maintenance, quickwin
Remaining Estimate: 0d
Time Spent: 0.25h
Original Estimate: Not Specified

Issue Links:
duplicate
is duplicated by CONTTAGS-104 tagfn.getContentByTags returns all it... Closed
relation
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Sprint: Maintenance 31
Story Points: 0.5

 Description   

The getNodesTaggedBy method might not always return the correct results.
On line 103, the clauses String is joined with the queryString, there's no separation of the different clauses though.
When using the logical operand "OR" you might get this query;
SELECT * FROM [nt:base] WHERE ISDESCENDANTNODE(/myFolder) AND [mgnl:tags] = 'myTag' OR [mgnl:tags] = 'mySecondTag'.
The "OR" in this clause negates the first ISDESCENDANTNODE condition and will give all content tagged with 'myTag' or 'mySecondTag' and not only under the selected folder.

The clauses variable should be encapsulated between parentheses "(" and ")"


Generated at Mon Feb 12 00:24:33 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.