View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0021712||mantisbt||filters||public||2016-09-23 04:24||2019-12-09 04:32|
|Target Version||2.23.0||Fixed in Version||2.23.0|
|Summary||0021712: No way to filter "negative" for checkbox custom fields|
If you create a checkbox custom field, you can use the View Issues filtering to look for the "positive" value that indicates the checkbox is checked easily enough, but there's currently no way to look for the "negative" (not checked) value; setting the search criteria to '[none]' in 1.3.1 returns nothing.
This appears to be a side-effect of the change over to the use of the vertical bar delimiter around field values in mantis_custom_field_string_table: the checked value is stored in the form "|value|", but the unchecked value is stored as the null string (""). If you manually set the custom field default value to "||" (the delimited null string), MantisBT complains about invalid values when submitting an issue. Setting the database column default value appears to do nothing, it would seem that Mantis constructs an explicit 'value=""' when populating the database.
In 1.2.X, this functionality worked as I would expect; filtering for '[none]' returned the "field not checked" issues. In order to reinstate the functionality (we have a number of filters that relied on searching for "custom fields unchecked") I've had to kludge the unchecked values in the database into being "||".
|Tags||No tags attached.|
If I've put this in the wrong category, please correct.
Given a test DB with 3 issues (1, 2 and 3), a checkbox custom field with a single element labelled 'on', and a custom_field_strings table with the following values (note, no CF string defined for issue 1)
Applying the 3 distinct filters combinations returns the following results
It's worth noting that in both versions, the "unchecked" item is consistently stored as empty string in mantis_custom_field_string_table.value
Note: I set product version to 1.3.0-rc.2, although the issue probably existed before but can't easily be reproduced due to the bug with the collapse settings cookie (0020822)
MantisBT: master 1c376741
Committer: vboctor Details Diff
|Fix filtering for "none" in multivalued custom fields
- Allows to use the value "none" in custom fields of type multiselection list
- Fix the filter query for searching "none" in mutivalued custom fields
that can be empty. Those are: checkbox and multiselection list.
Fixes: 0021712, 0026030
|mod - core/classes/BugFilterQuery.class.php||Diff File|
|mod - core/filter_form_api.php||Diff File|