View Issue Details

IDProjectCategoryView StatusLast Update
0022555mantisbtfilterspublic2021-12-25 08:14
Reportervboctor Assigned Tocproensa  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version2.2.2 
Target Version2.2.3Fixed in Version2.2.3 
Summary0022555: Regression in custom field sorting
Description

Due some recent change, the custom field sorting doesn't work in some cases. By doesn't work I mean that clicking on the custom field header on View Issues page has no effect. This didn't always happen, but after some investigations, I figured out that this happens in the case where a custom field is name "Some custom field" but references in View Issues columns list (from manage columns) as 'some custom field' (different case). The logic that shows the field is case insensitive, but the logic for sorting by the field is case sensitive.

If the custom field name in the Manage Columns configure is changed to use the correct case, the sorting works again.

Could this be introduced by 0017367 ?

TagsNo tags attached.

Relationships

related to 0022392 closedcproensa Sorting all bugs list using a column header after applying a filter resets the filter 
related to 0022325 closedcproensa Sort by custom field in View issues page - doesn't work - or you will get an error in "filters" 
related to 0029413 closeddregad APPLICATION ERROR 1300 Custom field not found with case-sensitive database 

Activities

atrol

atrol

2017-03-21 03:51

developer   ~0056137

Seems to be the issue which is mentioned at 0022392:0055731

cproensa

cproensa

2017-03-21 18:59

developer   ~0056149

I have provided a fix in 0022392
which certainly looks like your issue described, since setting sort order from column headers was resetting custom field filtering.

however, i don't think it has to do with case sensitiveness... that may be another issue?

vboctor

vboctor

2017-03-21 19:01

manager   ~0056150

@cproensa I'm pretty sure there is a case sensitivity issue since I was able to reproduce it, can you please test before / after your fix, so see if this issue is also fixed.

cproensa

cproensa

2017-03-21 19:51

developer   ~0056151

there is a case sensitivity issue

right, this issue is different than 0022392

I think that a proper fix would be to use custom field numeric ids in the parameters name for sorting and filter forms fields, instead of names.

vboctor

vboctor

2017-03-21 21:55

manager   ~0056154

Sounds good as long it doesn't break filters serialized in cookies or saved to db.

cproensa

cproensa

2017-03-22 21:09

developer   ~0056167

@vboctor try this PR: https://github.com/mantisbt/mantisbt/pull/1064

The approach is: when loading the columns from configuration, sanitize those referencing custom fields so that the actual cf names are used in runtime

Related Changesets

MantisBT: master-2.2 c612d8da

2017-03-22 16:45

cproensa

Committer: vboctor


Details Diff
Fix lowercase custom field column names

Fix column names for custom field columns that may be stored as
lowercase in configuration. See issue 0017367
If the system was working fine with lowercase names, then database is
case-insensitive, eg: mysql.
Fix by forcing a search with current name to get the id, then get the
actual name by looking up this id.

Fixes: 0022555
Affected Issues
0017367, 0022555, 0029413
mod - core/bug_api.php Diff File
mod - core/columns_api.php Diff File
mod - core/helper_api.php Diff File

MantisBT: master-2.25 d7c5f12f

2021-12-23 14:11

dregad


Details Diff
Custom field id lookup by name now case-insensitive

The $g_cache_name_to_id_map now uses lowercase custom field names as key
which prevents APPLICATION ERROR 1300 Custom field not found when using
a case-sensitive database.

This is a follow-up on issue 0022555, which did not properly fix the
problem (see commit c612d8da318a95bd2d4b8d9b6b6f4329d12e86fa).

Fixes 0029413
Affected Issues
0022555, 0029413
mod - core/custom_field_api.php Diff File

MantisBT: master 1c4d1524

2021-12-23 14:11

dregad


Details Diff
Custom field id lookup by name now case-insensitive

The $g_cache_name_to_id_map now uses lowercase custom field names as key
which prevents APPLICATION ERROR 1300 Custom field not found when using
a case-sensitive database.

This is a follow-up on issue 0022555, which did not properly fix the
problem (see commit c612d8da318a95bd2d4b8d9b6b6f4329d12e86fa).

Fixes 0029413

Ported from master-2.25 branch commit 6b9f68333bb3b7df085fe3ef830e331de62c7f03,
replacing `if(isset())` construct by null-coalescing operator.
Affected Issues
0022555, 0029413
mod - core/custom_field_api.php Diff File