View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0011561 | mantisbt | custom fields | public | 2010-02-26 03:15 | 2010-08-16 07:52 |
Reporter | Olaf123 | Assigned To | dhx | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 1.2.0 | ||||
Target Version | 1.2.1 | Fixed in Version | 1.2.1 | ||
Summary | 0011561: Filtering for custom field types multilist and checkbox does not work | ||||
Description | When I create a checkbox or multi select list, I can't get the filter to work on it. | ||||
Steps To Reproduce |
No issues will be returned | ||||
Additional Information | Using xdebug and eclipse I found that the multilist and the checkbox are treated different from other custom fields. There implementation is exactly the same though. The exception causes the faillure. By replacing the switch case statement at line 1899 in filter_api.php | ||||
Tags | No tags attached. | ||||
has duplicate | 0010901 | closed | dhx | We can't use & in custom field value and it's impossible search the first and last value from custom list |
has duplicate | 0009685 | closed | dhx | Custom fields of type "Checkbox" not filtered correctly |
has duplicate | 0010194 | closed | dhx | Filtering by Radio type custom field doesn't find anything |
Thanks for reporting this problem - it is now fixed :) BTW we can't just use the approach you listed by removing the LIKE clauses. Why? A value may be "option1|option2|option3" as stored in mantis_custom_field_string_table and therefore we can't just check if this column is equal to say "option2"... as "option2" may occur mid-way through the vertical pipe delimited string. My patch should work for all cases with multi-selection custom fields. Saying that, the current database storage approach for multi-select custom field types is horrible! The performance hit of needing to use multiple LIKE statements is of a real concern. In the future this is something I hope we can resolve. |
|
Thanks for fixing this so soon. I'll use your patch. |
|
MantisBT: master-1.2.x b03397ad 2010-03-04 07:49 Details Diff |
Fix 0011561: Filtering fails for multi-select custom field types When attempting to filter bugs based on multi-select custom fields, some bugs are not returned. This is due to multi-select custom field values being stored as a string in the database with a vertical pipe character being used as a delimiter between values. We can't just check for: LIKE '%|value|%' We also need to check for: LIKE 'value|%' LIKE '%|value' = 'value' To catch all possible cases of a value being stored within a multi-select custom field string. |
Affected Issues 0011561 |
|
mod - core/database_api.php | Diff File | ||
mod - core/filter_api.php | Diff File | ||
MantisBT: master 73d72e11 2010-03-04 07:49 Details Diff |
Fix 0011561: Filtering fails for multi-select custom field types When attempting to filter bugs based on multi-select custom fields, some bugs are not returned. This is due to multi-select custom field values being stored as a string in the database with a vertical pipe character being used as a delimiter between values. We can't just check for: LIKE '%|value|%' We also need to check for: LIKE 'value|%' LIKE '%|value' = 'value' To catch all possible cases of a value being stored within a multi-select custom field string. |
Affected Issues 0011561 |
|
mod - core/filter_api.php | Diff File | ||
mod - core/database_api.php | Diff File | ||
MantisBT: master 4c1a2785 2010-03-12 06:34 Details Diff |
Fix 0011561: Database storage format of CF multilist, checkbox and radio types Once upon a time multi-select custom field types (checkbox and multiselect) were stored in the database in the format of "option1|option2|option3" where they should have been stored in a format of "|option1|option2|option3|". Additionally, radio custom field types were being stored in the database with an unnecessary vertical pipe prefix and suffix when there is only ever one possible value that can be assigned to a radio field. This patch introduces a new schema upgrade function that corrects the invalid storage of checkbox, multiselect and radio custom fields in the database. |
Affected Issues 0011561 |
|
mod - core/install_helper_functions_api.php | Diff File | ||
mod - admin/schema.php | Diff File | ||
MantisBT: master-1.2.x b57e7449 2010-03-12 06:34 Details Diff |
Fix 0011561: Database storage format of CF multilist, checkbox and radio types Once upon a time multi-select custom field types (checkbox and multiselect) were stored in the database in the format of "option1|option2|option3" where they should have been stored in a format of "|option1|option2|option3|". Additionally, radio custom field types were being stored in the database with an unnecessary vertical pipe prefix and suffix when there is only ever one possible value that can be assigned to a radio field. This patch introduces a new schema upgrade function that corrects the invalid storage of checkbox, multiselect and radio custom fields in the database. |
Affected Issues 0011561 |
|
mod - admin/install_functions.php | Diff File | ||
mod - admin/schema.php | Diff File | ||
MantisBT: master 375a337d 2010-03-12 06:42 Details Diff |
Various custom field validation, filtering and performance fixes This commit is a roll-up of various bug fixes related to custom field implementations within MantisBT. In particular, multilist, checkbox and radio fields now work as expected when creating and updating bug reports as well as upon filtering on these custom field types. Fix 0011628: Checkbox custom field should allow no selections Fix 0011561: Reimplement an earlier patch to improve performance Fix 0011610: Reimplement custom field validation logic (see 0011628) |
Affected Issues 0010482, 0011561, 0011610, 0011628 |
|
mod - api/soap/mc_issue_api.php | Diff File | ||
mod - core/custom_field_api.php | Diff File | ||
mod - core/cfdefs/cfdef_standard.php | Diff File | ||
mod - bug_update.php | Diff File | ||
mod - bug_report.php | Diff File | ||
mod - core/filter_api.php | Diff File | ||
MantisBT: master-1.2.x bbe690f3 2010-03-12 06:42 Details Diff |
Various custom field validation, filtering and performance fixes This commit is a roll-up of various bug fixes related to custom field implementations within MantisBT. In particular, multilist, checkbox and radio fields now work as expected when creating and updating bug reports as well as upon filtering on these custom field types. Fix 0011628: Checkbox custom field should allow no selections Fix 0011561: Reimplement an earlier patch to improve performance Fix 0011610: Reimplement custom field validation logic (see 0011628) |
Affected Issues 0010482, 0011561, 0011610, 0011628 |
|
mod - bug_report.php | Diff File | ||
mod - core/custom_field_api.php | Diff File | ||
mod - api/soap/mc_issue_api.php | Diff File | ||
mod - bug_update.php | Diff File | ||
mod - core/cfdefs/cfdef_standard.php | Diff File | ||
mod - core/filter_api.php | Diff File |