View Issue Details

IDProjectCategoryView StatusLast Update
0021912mantisbttaggingpublic2016-11-27 00:45
Reportercproensa Assigned Tocproensa  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Product Version1.3.3 
Target Version1.3.4Fixed in Version1.3.4 
Summary0021912: Related tags are not showed correctly
Description

"Related tags" in tag_view_page.php, is not showed consistently
This is reproducible in non-mysql databases, due to the query being incorrectly built.

This is the wrong query built in pgsql:


SELECT * FROM mantis_bug_tag_table
WHERE tag_id != $4 AND bug_id IN ( SELECT b.id FROM mantis_bug_table b
LEFT JOIN mantis_project_user_list_table p
ON p.project_id=b.project_id AND p.user_id=$1 JOIN mantis_user_table u
ON u.id=$2 JOIN mantis_bug_tag_table t
ON t.bug_id=b.id
WHERE ( p.access_level>b.view_state OR u.access_level>b.view_state )
AND t.tag_id=$3 )

with the parameters passed as:
( $p_tag_id, $c_user_id, $c_user_id, $p_tag_id )

TagsNo tags attached.

Related Changesets

MantisBT: master-1.3.x 28291bb8

2016-11-13 10:24

cproensa

Committer: dregad


Details Diff
Fix the position of parameters in query

The creation of parameters while building a query must happen in the
same order that they appear in the final sql string, and the order in
the array passed to db_query().

Fixes: 0021912
Affected Issues
0021912
mod - core/tag_api.php Diff File