Save as... fails to populate fields if layer has similar names only different by case #21107
Labels
Bug
Either a bug report, or a bug fix. Let's hope for the latter!
Crash/Data Corruption
High Priority
Vectors
Related to general vector layer handling (not specific data formats)
Milestone
Author Name: Alexandre Neto (@SrNetoChan)
Original Redmine Issue: 13032
Affected QGIS version: master
Redmine category:vectors
When using "save as..." in a layer, the tool fails to fill all fields values correctly if there are columns with similar names (being CAPS the only difference; I know it's a bad policy to give similar names to columns, but... it's out of my reach)
QGIS will consider that the columns have the same name, and therefore will create a new column with a suffix (fieldname_1). So far so good. But then fails to populate the new column with values.
I have marked that it causes corruption since the output will not be what the user expects.
I believe that issue #21103 is also related. Have something to do with the QgsVectorFileWriter.
To replicate the problem one can create a memory layer and add two columns named 'fieldname' and 'FieldName', and add some features. Notice that the feature form won't work well and will fill both fields at the same time. Edit them in the attribute table. Save. Use Save as... to make the layer permanent.
Related issue(s): #21103 (relates)
Redmine related issue(s): 13027
The text was updated successfully, but these errors were encountered: