View Issue Details

IDProjectCategoryView StatusLast Update
0015265mantisbtcustom fieldspublic2014-09-23 18:05
Reporternimmich Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.2.12 
Target Version1.2.13Fixed in Version1.2.13 
Summary0015265: custom_field_get_id_from_name() doesn't cache result of obsolete custom field names
Description

If a custom field name changed, custom_field_get_id_from_name() keeps asking the database for an id over and over again (e. g. for every change of the field in the bug history to decide if it should be displayed).

Patch:

--- mantisbt-1.2.12\core\custom_field_api.php 2012-12-06 16:00:27.000000000 +0100
+++ mantisbt-1.2.12-new\core\custom_field_api.php 2012-12-06 16:19:09.000000000 +0100
@@ -648,12 +648,13 @@
$c_field_name = $p_field_name . '%';
}

$t_result = db_query_bound( $query, array( $c_field_name ) );

if( db_num_rows( $t_result ) == 0 ) {
  • $g_cache_name_to_id_map[$p_field_name] = false;
    return false;
    }

    $row = db_fetch_array( $t_result );
    $g_cache_name_to_id_map[$p_field_name] = $row['id'];

TagsNo tags attached.

Relationships

related to 0015721 closedgrangeway Functionality to consider porting to master-2.0.x 

Activities

dregad

dregad

2012-12-06 11:08

developer   ~0034501

Good catch, thank you for the patch

grangeway

grangeway

2013-04-05 17:56

reporter   ~0036107

Marking as 'acknowledged' not resolved/closed to track that change gets ported to master-2.0.x branch

Related Changesets

MantisBT: master-1.2.x 5cfca00c

2012-12-06 11:13

dregad


Details Diff
Cache obsolete custom field names

If a custom field name changed, custom_field_get_id_from_name() keeps
asking the database for an id over and over again (e.g. for every
change of the field in the bug history) to decide if it should be
displayed.

Thanks to user nimmich for noticing the issue and providing a patch.

Fixes 0015265
Affected Issues
0015265
mod - core/custom_field_api.php Diff File

MantisBT: master d7316184

2012-12-06 11:13

dregad


Details Diff
Cache obsolete custom field names

If a custom field name changed, custom_field_get_id_from_name() keeps
asking the database for an id over and over again (e.g. for every
change of the field in the bug history) to decide if it should be
displayed.

Thanks to user nimmich for noticing the issue and providing a patch.

Fixes 0015265
Affected Issues
0015265
mod - core/custom_field_api.php Diff File