View Issue Details

IDProjectCategoryView StatusLast Update
0011663mantisbtfilterspublic2014-02-14 09:16
Reporterschoppi71 Assigned Toatrol  
PriorityurgentSeveritycrashReproducibilityalways
Status closedResolutionunable to reproduce 
PlatformVM-WareOSSuSe Linux Enterprise ServerOS Version10
Product Version1.2.0 
Summary0011663: View issue page sorting customized fields failed
Description

If I add a customized field and apply it to the 'View Issues Columns' the sort function within the view issue page will fail. I'm using PostgreSQL 8.3.x database.

The problem is that within the SQL string an 'AS' is missing:

see line 4 in the SQL string: mantis_custom_field_string_table_1.value responsibility --> before responsibility an 'AS' has to be inserted

e.g. mantis_custom_field_string_table_1.value AS responsibility

Steps To Reproduce

Einter a cusotmized field e.g. responsibility
Add it to Manage - Manage Configuration - Manage Columns -'View Issues Columns'
Change to 'view issue' page and sort by responsibility

Additional Information

Error message - SQL:
SELECT DISTINCT mantis_bug_table.*, mantis_bug_table.last_updated, mantis_bug_table.date_submitted,
mantis_custom_field_string_table_1.value responsibility
FROM mantis_project_table, mantis_bug_table
LEFT JOIN mantis_custom_field_string_table mantis_custom_field_string_table_1
ON mantis_bug_table.id = mantis_custom_field_string_table_1.bug_id
AND mantis_custom_field_string_table_1.field_id = 1
WHERE mantis_project_table.enabled = 't'
AND mantis_project_table.id = mantis_bug_table.project_id
AND ( mantis_bug_table.project_id in (1, 4, 2, 3) )
ORDER BY responsibility DESC, mantis_bug_table.last_updated DESC, mantis_bug_table.date_submitted DESC;

TagsNo tags attached.

Activities

Hauptmann

Hauptmann

2010-05-06 11:28

reporter   ~0025427

Last edited: 2010-05-06 11:30

see also 0005859, 0008323

schoppi71

schoppi71

2010-05-11 01:57

reporter   ~0025459

I installed Version 1.2.1 but the problem isn't solved.

bibo

bibo

2010-05-18 09:45

reporter   ~0025532

same problem here. filter on custom field also crashes with sql-error.

schoppi71

schoppi71

2011-03-07 05:18

reporter   ~0028380

This is the problem:

mantis_custom_field_string_table_1.value responsibility --> missing AS
mantis_custom_field_string_table_1.value AS responsibility

Winthin version 1.2.4 this is also a problem:

mantis_project_table.enabled = 't' instead of mantis_project_table.enabled = 1

Custom-fileds must not contain minus and dots, this will also generate problems within SQL-STring for Postgress

schoppi71

schoppi71

2011-03-08 07:28

reporter   ~0028382

Solve the problem:

filter_api.php line 922:

$t_cf_select = "$t_cf_table_alias.value $c_cf_alias";
Bugfix:
$t_cf_select = "$t_cf_table_alias.value AS $c_cf_alias";

bibo

bibo

2011-11-03 07:19

reporter   ~0030154

Last edited: 2011-11-03 07:20

the error persists in version 1.2.8

with the bugfix from schoppi only custom fields which are not as type of "list" get sorted. can you confirm this?

the sql error with custom fields of type "list" is:
ERROR: ORDER BY "status" is ambiguous at character 544 for the query: SELECT DISTINCT mantis_bug_table.*, mantis_bug_table.last_updated, mantis_bug_table.date_submitted, mantis_custom_field_string_table_7.value AS status FROM mantis_project_table, mantis_bug_table LEFT JOIN mantis_custom_field_string_table mantis_custom_field_string_table_7 ON mantis_bug_table.id = mantis_custom_field_string_table_7.bug_id AND mantis_custom_field_string_table_7.field_id = 7 WHERE mantis_project_table.enabled = ? AND mantis_project_table.id = mantis_bug_table.project_id AND ( mantis_bug_table.project_id = 5 ) ORDER BY status ASC, mantis_bug_table.last_updated DESC, mantis_bug_table.date_submitted DESC

atrol

atrol

2014-02-01 13:58

developer   ~0039280

This issue is not reproducible with the current version of MantisBT.

We recommend that you upgrade to the latest stable version [1]; if after doing so the problem persists, do not hesitate to reopen the issue, with additional relevant information.

[1] http://www.mantisbt.org/download.php