View Issue Details

IDProjectCategoryView StatusLast Update
0026362mantisbtcustom fieldspublic2019-12-02 17:15
Reportergreentoothbrush Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionno change required 
Platform64 BitOSWindows 
Product Version2.22.1 
Summary0026362: Multiselection list have "|" in the values in the database - these are removed on the UI
Description

Multiselection has 3 entries:
Item A| Item B | Item C

These will be stored as values in the database as "|Item A|", "|Item B|", "|Item C|"

If an "Item A" is directly added to the database (i.e. loading data), it will not match "|Item A|" from the Multiselection

On the UI this is confusing as "|Item A|" is shown as "Item A",
hence it appears that "Item A" != " "Item A"

To workaround the issue add "|" around values when adding them to the database directly

Steps To Reproduce

Create a Multiselection
Add some entries via the UI
Check the values in the database

I have added pic_001 and pic_002
This shows the issue with value "TBD"

"TBD" is shown on the UI
"|TBD|" is the value in the database

In pic_002 bug_id = 10, 364 and 365 have been entered via the UI. bug_id = 366, 466, 467 have been added directly to the database
In both cases the understand the "TBD" was to be the value

TagsNo tags attached.

Activities

greentoothbrush

greentoothbrush

2019-11-15 06:33

reporter  

pic_001.PNG (1,708 bytes)   
pic_001.PNG (1,708 bytes)   
pic_002.PNG (7,468 bytes)   
pic_002.PNG (7,468 bytes)   
dregad

dregad

2019-11-15 08:46

developer   ~0063099

The | is a delimiter for multi-selection custom fields, and MantisBT needs to store them to be able to handle the case when there are multiple values selected, e.g. with 2 values, they would be stored as |Item A|Item B|.

If an "Item A" is directly added to the database (i.e. loading data),

That is your problem - you're manually updating the database.

We do not support nor recommend doing so. If you really must, then you should make sure that the data you insert adheres to the format defined by MantisBT core, and if you don't, then do not be surprised that things don't work as expected...

Anyway, as you have already pointed out, the only solution (and not workaround) is to

add "|" around values when adding them

This is not a bug of MantisBT which works as designed. I am therefore resolving this issue as "no change required".

Issue History

Date Modified Username Field Change
2019-11-15 06:33 greentoothbrush New Issue
2019-11-15 06:33 greentoothbrush File Added: pic_001.PNG
2019-11-15 06:33 greentoothbrush File Added: pic_002.PNG
2019-11-15 08:46 dregad Assigned To => dregad
2019-11-15 08:46 dregad Status new => resolved
2019-11-15 08:46 dregad Resolution open => no change required
2019-11-15 08:46 dregad Note Added: 0063099
2019-12-02 17:15 atrol Status resolved => closed