View Issue Details

IDProjectCategoryView StatusLast Update
0011631mantisbtcustom fieldspublic2010-06-09 03:45
ReporterRyanLind Assigned Todhx  
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionduplicate 
Product Version1.2.0 
Summary0011631: Custom Fields with special characters in the name cause SQL errors on sort.
Description

If I create a custom field with a character in it such as "(" or "#" and I added it as a column to my view issues, sorting on this column causes a crash:

Database query failed. Error received from database was 0001051: Unknown table 'mantis_bug_table' for the query: SELECT DISTINCT mantis_bug_table.*, mantis_bug_table.last_updated ...

I then go to Manage custom fields and rename it (Eg test # -> test number) and it works fine. I can sort on it and everything.

I've seen some similar issues related to sorting on custom fields, but none quite the same as this.

Steps To Reproduce

1) Create a custom field with a # sign (e.g. "Test #")
2) Add this custom field to your view issues columns in "my account"->"manage columns"
3) Go to "View Issues"
4) Try to sort on "test #"

Additional Information

The offending code is in filter_api.php on line 2,018 (as of 1.2.0):

----PHP------
$t_result = db_query_bound( "$t_select_string $t_from_string $t_join_string $t_where_string $t_order_string", $t_query_clauses['where_values'], $p_per_page, $t_offset );
---END PHP---

The above causes the SQL error.

TagsNo tags attached.

Relationships

duplicate of 0010901 closeddhx We can't use & in custom field value and it's impossible search the first and last value from custom list 
related to 0011634 closeddhx using special characters on Custom Field name generates issue when trying to order by this CF 

Activities

There are no notes attached to this issue.