Permalink
Browse files

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 #15265
  • Loading branch information...
1 parent 8c9038f commit 5cfca00c6e2b24717c3eecbd0a2b578d69ce6eb0 @dregad dregad committed Dec 6, 2012
Showing with 1 addition and 0 deletions.
  1. +1 −0 core/custom_field_api.php
@@ -651,6 +651,7 @@ function custom_field_get_id_from_name( $p_field_name, $p_truncated_length = nul
$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;
}

0 comments on commit 5cfca00

Please sign in to comment.