View Issue Details

IDProjectCategoryView StatusLast Update
0017457mantisbtfilterspublic2014-12-05 18:33
Reporterkelson Assigned Todregad  
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionfixed 
Product Version1.2.17 
Target Version1.2.18Fixed in Version1.2.18 
Summary0017457: Column summary of the free text search is not prefixed by table (filter_api)
Description

Hi,

Since I installed a plugin with a join on mantis_bug_table, when the column of the plugin and the free text serach are used, I have this error message :
Database query failed. Error received from database was 0001052: Column 'summary' in where clause is ambiguous for the query

I took a look at the filter_api and I found the issue at line 1979.

$t_textsearch_where_clause .= '( ' . db_helper_like( 'summary' ) .
should be modified into
$t_textsearch_where_clause .= '( ' . db_helper_like( "$t_bug_table.summary" ) .

TagsNo tags attached.

Activities

dregad

dregad

2014-06-19 12:44

developer   ~0040835

Thanks for the report, I'll try to have a look later this week

dregad

dregad

2014-06-19 12:46

developer   ~0040836

BTW, can you provide details (link, source code) on the plugin causing this issue ?

kelson

kelson

2014-06-20 03:38

reporter   ~0040837

Last edited: 2014-06-20 03:38

Hi dregad,

The plugin causing this issue is an internal plugin.
It allows our users to filter on the project of related issues.
So on a filter, we have to join relationship table and bug table.

$t_query = array(
'join' => "LEFT JOIN mantis_bug_relationship_table prt ON prt.source_bug_id = mantis_bug_table.id
LEFT JOIN mantis_bug_table pbt ON prt.destination_bug_id = pbt.id",
'where' => "pbt.project_id IN ( $t_prod_allo_ids ) AND prt.relationship_type = $t_rel"
);

Related Changesets

MantisBT: master-1.2.x d345c5b8

2014-06-19 12:35

dregad


Details Diff
Filter API: add missing table prefix

When building the where clause for free-text search, the filter API did
not prefix the 'summary' column with the table name.

Fixes 0017457
Affected Issues
0017457
mod - core/filter_api.php Diff File

MantisBT: master 7ee12d37

2014-06-19 12:35

dregad


Details Diff
Filter API: add missing table prefix

When building the where clause for free-text search, the filter API did
not prefix the 'summary' column with the table name.

Fixes 0017457
Affected Issues
0017457
mod - core/filter_api.php Diff File