View Issue Details

IDProjectCategoryView StatusLast Update
0021712mantisbtfilterspublic2016-12-30 16:24
ReporterPantsManUK 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status confirmedResolutionopen 
Product Version1.3.0-rc.2 
Target Version1.3.xFixed in Version 
Summary0021712: No way to filter "negative" for checkbox custom fields
Description

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 theres currently no way to look for the negative (not checked) value; setting the search criteria to [none] in 1.3.1 returns nothing.

Additional Information

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) Ive had to kludge the unchecked values in the database into being ||.

TagsNo tags attached.

Relationships

Activities

PantsManUK

PantsManUK

2016-09-23 04:25

reporter   ~0054066

If Ive put this in the wrong category, please correct.

dregad

dregad

2016-09-23 08:47

developer   ~0054068

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)

field_id  bug_id  value
1         2       <blank>
1         3       |on|

Applying the 3 distinct filters combinations returns the following results

In 1.2.x:

  • checkbox = [any]: 1, 2, 3
  • checkbox = [none]: 1, 2
  • checkbox = on: 3

In 1.3.x:

  • checkbox = [any]: 1, 2, 3
  • checkbox = [none]: 1
  • checkbox = on: 3

Its worth noting that in both versions, the unchecked item is consistently stored as empty string in mantis_custom_field_string_table.value

dregad

dregad

2016-09-23 08:51

developer   ~0054069

Note: I set product version to 1.3.0-rc.2, although the issue probably existed before but cant easily be reproduced due to the bug with the collapse settings cookie (0020822)

Issue History

Date Modified Username Field Change
2016-09-23 04:24 PantsManUK New Issue
2016-09-23 04:25 PantsManUK Note Added: 0054066
2016-09-23 08:47 dregad Status new => confirmed
2016-09-23 08:47 dregad Note Added: 0054068
2016-09-23 08:51 dregad Product Version 1.3.1 => 1.3.0-rc.2
2016-09-23 08:51 dregad Target Version => 1.3.2
2016-09-23 08:51 dregad Note Added: 0054069
2016-10-02 19:16 dregad Target Version 1.3.2 => 1.3.3
2016-10-30 23:23 vboctor Target Version 1.3.3 => 1.3.4
2016-11-27 08:22 dregad Target Version 1.3.4 => 1.3.5
2016-12-30 16:24 atrol Target Version 1.3.5 => 1.3.x