Bug report #814
attribute reference in mapfiles are exported with index instead of fieldnames
|Affected QGIS version:||Regression?:||No|
|Operating System:||All||Easy fix?:||No|
|Pull Request or Patch supplied:||Resolution:||fixed|
|Crashes QGIS or corrupts data:||Copied to github as #:||10873|
when a qgis project is converted to a mapfile the references to layer attributes are exported as field index instead of field name, eg. LABELITEM 0 instead of the name of the first field. Same applies to CLASSITEMs.
AFAICS this cannot be easily fixed, because the project file doesn't contain information about the attribute names. Maybe that should be changed anyway as the attributes or their order in the table might change, although the references fields still exists.
#1 Updated by Gary Sherman almost 14 years ago
This requires a change in the QgsProject code to either:
1. write a separate xml tag containing the actual field name
2. eliminate the use of the field index and use the name instead
Item 1 is probably the simplest at present and wouldn't impact existing project read/write routines.
The mapserver exporter currently has no way to open data sets and retrieve the field information, given we are dealing with file-based and PostGIS data stores.
#4 Updated by Gary Sherman almost 14 years ago
- Status changed from Closed to Feedback
- Resolution deleted (
This doesn't work. The default label text is being written to the XML rather than the name of the label field. I think the changes may need to be made in QgsLabel::writeXML in order to get the correct field name.