View Issue Details

IDProjectCategoryView StatusLast Update
0020248mantisbtcustom fieldspublic2016-11-27 00:45
Reportertristan.prudhomme Assigned Tocproensa  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformWampServer 2.2 / Postgres 9.1.13OSWindows 7 SP1 Pro 
Product Version1.2.16 
Target Version1.3.4Fixed in Version1.3.4 
Summary0020248: Custom field named with capital letters like "Component" doesn't display on views
Description

When Adding the custom field Component from "manage_config_columns_page.php" the result on the "view_all_bug_page.php" is @Component@.
It's seems to be the fault of the query in the function "custom_field_get_id_from_name" in file "custom_field_api.php".

The query is SELECT id FROM $t_custom_field_table WHERE name = ? where in my case $t is "mantis" and parameter ? is Component.

On execute there is no result found i've tried to replace the "=" by ILIKE and that's works.

TagsNo tags attached.

Relationships

related to 0017367 closedcproensa Custom Field - On The Manage Columns - Mantis changed value to lower case 
has duplicate 0021713 closedatrol Manage Columns lowercase field name 
related to 0019408 closedcproensa case sensitive in Oracle 

Activities

dregad

dregad

2015-11-03 09:02

developer   ~0051808

I was able to replicate this problem, which seems to be specific to PostgreSQL - the issue is not reproducible with MySQL.

guerinetn

guerinetn

2016-09-23 18:06

reporter   ~0054070

The issue is due to a force lowercase on manage custom field page.
When adding the field in the view issues field, the term are forced lower case.

If you test with your issue, you would see that you type custom_field_Component but the value saved in databased is custom_field_component.

guerinetn

guerinetn

2016-09-23 18:12

reporter   ~0054071

You could test in the administration > configuration page you could force some parameter.
This page doesn't apply a lower case to the value you enter.

WIth this test you could see that if you have custom_field_Component, the custom field is displayed rightfully.

The problem doesn't exist on MySQL because MySQL queries are case insensitive. It appear on PostgreSQL because PostgreSQL queries are case sensitives.

Related Changesets

MantisBT: master-1.3.x 414d19dd

2016-11-18 14:44

cproensa

Committer: vboctor


Details Diff
Don't force lowercase for custom field column names

Custom field names are referenced by name in columns definitions.
There were some conversions in place to compare column names by
converting to lowercase.
However, the field name is stored in custom fields table without any
conversion. This causes:
- The configured columns array can be inconsistent with the available
columns names.
- When the database uses case sensitive matching, the columns are not
shown properly and are presented as not existant.

So given that custom field names are already stored with unrestricted
names, which include spaces and non-alphanumeric characters, forcing
them to lowercase while treating them is not a significant requirement
at the moment.

Fixes: 0017367, 0020248
Affected Issues
0017367, 0020248
mod - core/columns_api.php Diff File