View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0005926 | mantisbt | administration | public | 2005-07-12 12:46 | 2014-09-23 18:05 |
Reporter | Paul_Berg | Assigned To | dregad | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 1.0.0a3 | ||||
Target Version | 1.2.6 | Fixed in Version | 1.2.6 | ||
Summary | 0005926: 'None' filter on checkbox field doesn't return bugs with a blank custom field value (as opposed to null/undefined values) | ||||
Description | I have created a custom field of the type "checkbox" with 3 possible values A, B and C. Am I doing something wrong, or is this a bug? Paul | ||||
Tags | patch | ||||
Attached Files | 0001-Fix-0005926-Filter-None-for-custom-fields-with-blank.patch (1,284 bytes)
From ba7a63804f409c47c95ee192440b4be64e63a458 Mon Sep 17 00:00:00 2001 From: Damien Regad <damien.regad@merckserono.net> Date: Tue, 18 Jan 2011 12:55:40 +0100 Subject: [PATCH] Fix #0005926: Filter "None" for custom fields with blank value Generate the correct where clause for custom fields of type Checkbox and Multiselection list, to return both bugs having an empty value ('', as opposed to NULL) in the field as well as those without matching record in mantis_custom_field_string_table. --- core/filter_api.php | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/core/filter_api.php b/core/filter_api.php index 7b244c3..f2d6b43 100644 --- a/core/filter_api.php +++ b/core/filter_api.php @@ -1899,7 +1899,10 @@ function filter_get_bug_rows( &$p_page_number, &$p_per_page, &$p_page_count, &$p switch( $t_def['type'] ) { case CUSTOM_FIELD_TYPE_CHECKBOX: case CUSTOM_FIELD_TYPE_MULTILIST: - $t_where_params[] = '%|' . $t_filter_member . '|%'; + if( $t_filter_member != '' ) { + $t_filter_member = '%|' . $t_filter_member . '|%'; + } + $t_where_params[] = $t_filter_member; array_push( $t_filter_array, db_helper_like( "$t_table_name.value" ) ); break; default: -- 1.7.1 | ||||
A filter value of [none] checks for '%||%" rather than ''. |
|
It is possible that there may also be no record in the mantis_custom_field_string_table for every bug_id, so searching for '' won't return all of the values. One of my custom field's write access is set to "manager" and I have several issues with missing values in the mantis_custom_field_string_table. The values get created when a "manager" or above updates the issue. |
|
This is what I'd expect too and more importantly, what my boss would expect. Any chance of a fix? |
|
You will find attached a patch that fixes the issue for me. I tested it for correct behavior in the following cases for the custom field:
|
|
Marking as 'acknowledged' not resolved/closed to track that change gets ported to master-2.0.x branch |
|
MantisBT: master-1.2.x c5cb6dfa 2011-01-17 22:55 Details Diff |
Fix 0005926: Filter "None" for custom fields with blank value Generate the correct where clause for custom fields of type Checkbox and Multiselection list, to return both bugs having an empty value ('', as opposed to NULL) in the field as well as those without matching record in mantis_custom_field_string_table. |
Affected Issues 0005926 |
|
mod - core/filter_api.php | Diff File |