stable

Clone or download

Read-only

fix: Fatal error for TQL with parenthesis

TQL with parenthesis like `A and (B or C)` are failing due to recent refactoring around TQL definition. Since the begining of TQL, parenthesis were just a syntax wrapper around an or expression. Since we hardened types around terms and visitors, there is now a gap when a parenthesis is used: and expression is expecting a term but since the parser unwrap the parenthesis, we get a fatal error because or expression (provided by parenthesis) is not a Term (it is a Logical). In order to fix the situation, we now provide a Parenthesis (which is a Term) so that we can unwrap ourselves the or expression. Rest tests have been updated in order to better catch this kind of regressions. Closes request #32285: TQL related PHP fatal error at tracker report display Part of story #32281: Search artifacts with/without parents via TQL Change-Id: Ic7e4e9f43dc66d48a4f0594753b5591f4eaecb23

Modified Files

Name
M plugins/crosstracker/include/CrossTracker/Report/Query/Advanced/InvalidTermCollectorVisitor.php +6 −0 Go to diff View file
M plugins/crosstracker/include/CrossTracker/Report/Query/Advanced/QueryBuilderVisitor.php +6 −0 Go to diff View file
M plugins/tracker/grammar/src/tql.pegjs +4 −2 Go to diff View file
M plugins/tracker/grammar/test_parser.php +4 −4 Go to diff View file
A plugins/tracker/include/Tracker/Report/Query/Advanced/Grammar/Parenthesis.php +34 −0 Go to diff View file
M plugins/tracker/include/Tracker/Report/Query/Advanced/Grammar/TermVisitor.php +7 −0 Go to diff View file
M plugins/tracker/include/Tracker/Report/Query/Advanced/InvalidFields/Date/DateToEmptyStringTermException.php +6 −0 Go to diff View file
M plugins/tracker/include/Tracker/Report/Query/Advanced/InvalidFields/FloatFields/FloatToEmptyStringTermException.php +6 −0 Go to diff View file
M plugins/tracker/include/Tracker/Report/Query/Advanced/InvalidFields/Integer/IntegerToEmptyStringTermException.php +6 −0 Go to diff View file
M plugins/tracker/include/Tracker/Report/Query/Advanced/InvalidFields/ListFields/ListToEmptyStringTermException.php +6 −0 Go to diff View file
M plugins/tracker/include/Tracker/Report/Query/Advanced/InvalidTermCollectorVisitor.php +6 −0 Go to diff View file
M plugins/tracker/include/Tracker/Report/Query/Advanced/QueryBuilderVisitor.php +6 −0 Go to diff View file
M plugins/tracker/include/Tracker/Report/Query/Advanced/SizeValidatorVisitor.php +6 −0 Go to diff View file
M plugins/tracker/tests/rest/TQL/TQLTest.php +2 −0 Go to diff View file