View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0012680 | mantisbt | custom fields | public | 2011-01-12 04:27 | 2014-09-23 18:05 |
Reporter | matt77 | Assigned To | dregad | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 1.2.3 | ||||
Target Version | 1.2.9 | Fixed in Version | 1.2.9 | ||
Summary | 0012680: Custom field name with paranthesis leads to db error message when sorting "view issues" | ||||
Description | Follow the steps to reproduce. An error message appears starting with "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(field) FROM mantis_project_table [...]" | ||||
Steps To Reproduce | Create a custom field with paranthesis, e.g. "My custom (field)". | ||||
Tags | No tags attached. | ||||
related to | 0012404 | closed | dregad | custom field sort issue on view issues page |
related to | 0015721 | closed | grangeway | Functionality to consider porting to master-2.0.x |
has duplicate | 0008323 | closed | dregad | Spaces in custom fields |
related to | 0012170 | closed | dregad | SQL syntax error occurs when sorting it by the custom field where special character is included. |
Temporary solution is to remove the paranthesis. Sorting works just fine afterwards |
|
Possible fixes on filter_api.php:920 1) Quote the alias (non-standard SQL): 2) Ignore the actual name of the field, and use another string for the alias. IMO is better to use the custom field ID: |
|
@Dentxinho, thanks for the suggestion for the fix. |
|
You're welcome. BTW, Github changesets are not attached to bugs anymore? |
|
I think there's a problem with the source control plugin for github atm, which prevents changesets from being attached automatically. jreese has not had time to figure out exactly what it is and fix the code yet, so they are loaded manually every once in a while. |
|
Marking as 'acknowledged' not resolved/closed to track that change gets ported to master-2.0.x branch |
|
MantisBT: master 170e9397 2011-12-07 04:55 Details Diff |
Define custom field alias using id instead of name The old method of defining a custom field alias based on the field's name, generated SQL syntax error when trying to sort on that field in the view issues page, if the name contains characters not valid for an SQL identifier (e.g. '-', '(', ')', etc). Fixes 0012404, 0012680 |
Affected Issues 0012404, 0012680 |
|
mod - core/filter_api.php | Diff File | ||
MantisBT: master-1.2.x 8fb27ae7 2011-12-07 04:55 Details Diff |
Define custom field alias using id instead of name The old method of defining a custom field alias based on the field's name, generated SQL syntax error when trying to sort on that field in the view issues page, if the name contains characters not valid for an SQL identifier (e.g. '-', '(', ')', etc). Fixes 0012404, 0012680 |
Affected Issues 0012404, 0012680 |
|
mod - core/filter_api.php | Diff File |