Bug report #16967
value relation widget with Allow multiple selection doesn't resolve the values anymore
|Affected QGIS version:||master||Regression?:||Yes|
|Operating System:||Debian Stretch||Easy fix?:||No|
|Pull Request or Patch supplied:||Yes||Resolution:|
|Crashes QGIS or corrupts data:||Yes||Copied to github as #:||24866|
Steps to reproduce:
- Add a PostgreSQL layer with a integer column
- Add a Value relation layer and point it to the array column
- The values get saved in the DB when creating a feature
- The widget cannot present the values stored in the database when the feature form gets popped and the user can overwrite them without knowing
I've also attached a GIF.
#3 Updated by Tudor Bărăscu over 2 years ago
- File bug.jpg added
I think instead of a dump and a project it's easier to just create the tables:
CREATE TABLE test (id serial PRIMARY KEY, location integer, geom geometry(Point, 4326)); CREATE TABLE location_type (id serial PRIMARY KEY, value text); INSERT INTO location_type (value) VALUES ('sidewalk'); INSERT INTO location_type (value) VALUES ('asphalt'); INSERT INTO location_type (value) VALUES ('sand'); INSERT INTO location_type (value) VALUES ('soil');]]
add the layers in a project, and configure the location widget as a value relation like so:
Then, add a new point and select some of the locations.
They will get saved in the database.
However, opening the form on the same point shows an empty location part.
#5 Updated by Luigi Pirelli about 2 years ago
seems the error is here:
misformatting the string list... the result resutn a empty list.
debugging the value is simply an Int array
find the way to correctly generate the keyList