Bug report #21986

Can not save data of type "array of characters (StringList / JSONSTRINGLIST) "on a layer connected to a spatialLite base : error : Type 5 of the x attribute of the entity y is unknown

Added by Mickaël CALLAC over 5 years ago. Updated over 5 years ago.

Status:Open
Priority:High
Assignee:Alessandro Pasotti
Category:Data Provider/SpatiaLite
Affected QGIS version:3.4.7 Regression?:Yes
Operating System:Windows 10 Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:29801

Description

Test environment:
QGis 3.4.7-1 (LTR)
database: spatiaLite

The error appears in the case of a layer connected to a base SpatiaLite (generated by ogr2ogr) and for an array type field characters. The field in QGis has been set as "value relational ", the option" Allow multiple selections "is checked.

The field in QGis has the following properties:

Type: QString
Identity type: StringList
This is a field of type "JSONSTRINGLIST" in the base spatiaLite
When saving this field, the following error appears: 2019-05-03T11: 39: 48
CRITICAL Layer name layer: Type 5 of the x attribute of the entity y is unknown.

base.zip - fields concerned : degradation, type_trvx_haie, habitat_spe, trvx_gest_cepees, trvx_gest_futai, creation_motivation (1.64 MB) Mickaël CALLAC, 2019-05-03 12:49 PM

History

#1 Updated by Giovanni Manghi over 5 years ago

  • Status changed from Open to Feedback

Did it worked as expected in a previous QGIS release?

#2 Updated by Mickaël CALLAC over 5 years ago

Yes, it worked well in QGis 2.18, since the version 3 it didn't work.

#3 Updated by Giovanni Manghi over 5 years ago

  • Priority changed from Normal to High
  • Status changed from Feedback to Open

#4 Updated by Alessandro Pasotti over 5 years ago

  • Assignee set to Alessandro Pasotti

#5 Updated by Alessandro Pasotti over 5 years ago

Is it the attached file a direct ogr2ogr output?

The encoded jsonarrays look wierd to me:

this is not valid json:

{EC,ER,MA,PH}

it should probably be

["EC","ER","MA","PH"]

#6 Updated by Mickaël CALLAC over 5 years ago

The dataBase SpatiaLite output is an export from a DB PostGis by ogr2ogr.
The fields in PostGis are typed in array (character varying []) and contains value which look like {EC,ER,MA,PH}, ogr2ogr keep the same format in the spatiaLite database.

Also available in: Atom PDF