mobile icon indicating copy to clipboard operation
mobile copied to clipboard

Strange labels for NULL values of attributes with value map form widget

Open erpas opened this issue 3 years ago • 7 comments

Whenever you have a value map for a field defined in the form that includes the NULL value and you set a non-NULL value first and then try to set it to NULL, if you have a label based on that field you would get that strange string as shown below instead of an empty string.

obraz

This happens only when modifying a feature in MM Input - in QGIS, when the value-mapped field is modified to NULL the label is empty, as expected.

I have created a simple public project to replicate and test the issue: https://app.merginmaps.com/projects/rpasiok/test_value_map_labels/tree

MM Input version: 1.7.0 on Android 10

erpas avatar Sep 13 '22 13:09 erpas

@erpas Is there any udpate on this ticket please? This is causing issues in other places for us now. @HugoP27 @chris9404

CJHacking93 avatar Nov 07 '22 14:11 CJHacking93

I would like to add to this issue. We have had another instance of this occur - not specific to labels.

I suspect what has happened is somebody has changed the value of the Action Status fields and then reverted back to <NULL> causing the values to store a UID and the represent_value() is <NULL>.

Hopefully the screenshots below will assist. Feel free to contact me if additional information is required.

image image image image

@HugoP27

CJHacking93 avatar Nov 08 '22 07:11 CJHacking93

Good day,

Is there any progress with this issue please?

This is a problem for when you want to reset a field, as this is currently the only work-around.

@tomasMizera perhaps you could assist me please?

CJHacking93 avatar Sep 22 '23 13:09 CJHacking93

Hi @Hackster93 Chris, sorry to hear you still have troubles with this one. How often do you bump into it?

tomasMizera avatar Sep 25 '23 13:09 tomasMizera

Hi @tomasMizera, thanks for the response. It is in an app that was developed last year and has been sidelined until our new season which has just started. We need NULL options in the lists so that the users can reset a value if they no longer want a value selected for the attribute. This is going to be a consistent issue for us. I am currently trying to determine the python code to refactor the fields after the fact, but not having any luck here either (this would hopefully be a short-term work-around).

CJHacking93 avatar Sep 26 '23 06:09 CJHacking93

Hi Mergin Maps Team, I hope you are well 💪 Is there any progress on this ticket? I was hoping it would have been tackled in the "Bug Drive".

CJHacking93 avatar Nov 09 '23 09:11 CJHacking93

It seems it is a valid value for NULL in QGIS value maps. See https://api.qgis.org/api/3.28/classQgsValueMapFieldFormatter.html#abfd8d1bf0fbee532ca0b95c840101bcf

@tomasMizera not sure how to make it displayed properly.

erpas avatar Nov 24 '23 11:11 erpas