Are checkbox custom fields even stranger in MBT 1.3?

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
mlcrane
Posts: 27
Joined: 21 Apr 2011, 08:21

Are checkbox custom fields even stranger in MBT 1.3?

Post by mlcrane »

We have a single checkbox custom field with a single Possible Value, and in v1.2 we had a saved filter that looked for this field to be [none] (along with a few other conditions), and all was right with the world - the filter worked.

Following pushing the v1.3 upgrade, I've had to set the default value of this custom field to '||' (and 'mung' the database to give all the previously blank values the new default) to get this same functionality working. I don't recall this being documented anywhere?

Just a heads up really. As I say, figured out that a default value was required to reinstate the old functionality.

Edit reason: typos
mlcrane
Posts: 27
Joined: 21 Apr 2011, 08:21

Re: Are checkbox custom fields even stranger in MBT 1.3?

Post by mlcrane »

Welp...

Setting a default value failed ("invalid value for field Blah" on submit, even though Blah isn't required ever, and isn't displayed except On Edit). Guess I'll have to set the default in the DB so that the front-end still works correctly.
mlcrane
Posts: 27
Joined: 21 Apr 2011, 08:21

Re: Are checkbox custom fields even stranger in MBT 1.3?

Post by mlcrane »

And that doesn't work either; guessing Mantis creates the database entry with a value of '' (the null string).

I suspect that this may, in fact, be a bug of some description, either in 1.2.X that has carried over with this custom field or in how 1.3.X handles checkbox fields now. That or it's something that our local changes has triggered; I'll need to run a default MBT 1.3 to see how it behaves with checkbox custom fields to know for sure.

Feel free to step in any time @atrol :D
mlcrane
Posts: 27
Joined: 21 Apr 2011, 08:21

Re: Are checkbox custom fields even stranger in MBT 1.3?

Post by mlcrane »

[strike]Bug Report

Version: 1.3.1
Summary: 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 value that indicates a checked checkbox easily enough, but there's (currently) no way to look for the inverse. Setting the search criteria to '[none]' returns nothing. This appears to be a side-effect of the internal use of vertical bars as delimiters around field values in mantis_custom_field_string_table: the checked value will be of the form "|Value|", but the unchecked value will be "" (the null string). If you manually set the custom field to have a Default Value of "||" (let's call this the "delimited null string"), Mantis complains about invalid values when submitting an issue. Setting a default value for the field within the database itself resolves nothing because when Mantis creates the database row(s), it appears to be explicitly setting the value for the unchecked field to the null string. In 1.2.X, searching for "[none]" would return the unchecked values, to reinstate that functionality in 1.3.X, you have to manually change the null string values in the database to delimited null strings (least ways, this is what I have had to do in our production install to keep the "custom field not checked" filters we have working; I'm now going to fabricobble a kludge into custom_field_set_value() that does this for me).[/strike]
Last edited by mlcrane on 23 Sep 2016, 08:28, edited 1 time in total.
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Are checkbox custom fields even stranger in MBT 1.3?

Post by atrol »

@micrane, please report the bug at https://www.mantisbt.org/bugs
Please use Search before posting and read the Manual
mlcrane
Posts: 27
Joined: 21 Apr 2011, 08:21

Re: Are checkbox custom fields even stranger in MBT 1.3?

Post by mlcrane »

#21712 (had to ask for a password reset, I'd forgotten whatever it was...)
Post Reply