Bug report #17395

Fields of memory layers are renamed automatically by the translation

Added by Georg Wicke over 3 years ago. Updated over 2 years ago.

Category:Data Provider
Affected QGIS version:2.14.3 Regression?:No
Operating System:Ubuntu Easy fix?:No
Pull Request or Patch supplied:No Resolution:no timely feedback
Crashes QGIS or corrupts data:No Copied to github as #:25292


Steps to reproduce

Requires the german version of QGIS.

1. Create a vector memory layer through PyQGIS
2. Add a field named "id" via the dataProvider of the layer
3. Add the layer to the registry
4. Open the attribute table

Expected behaviour: A column named "id" is visible.

Observed behaviour: The column is named "Objektkennung". The actual field name is changed, too - e. g. if a script accesses a feature's attribute through `feature["id"]`, a KeyError is raised. The script has to use the field id instead to work consistently across machines.

This is quite dramatic, as it may unexpectedly wreck a lot of scripts and plugins that "work just fine" for the developer.


#1 Updated by Jürgen Fischer over 2 years ago

  • Status changed from Open to Feedback

Please test with QGIS 3.4 - QGIS 2.18 reached it's end of life.

#2 Updated by Giovanni Manghi over 2 years ago

  • Resolution set to no timely feedback
  • Status changed from Feedback to Closed

Also available in: Atom PDF