Bug report #3857
Shapefile cannot be saved if joined table contains field names longer than 10 characters
|Affected QGIS version:||Regression?:||No|
|Operating System:||Linux||Easy fix?:||No|
|Pull Request or Patch supplied:||Resolution:||fixed|
|Crashes QGIS or corrupts data:||Copied to github as #:||13915|
A layer with another table joined to it using attribute values (as possible from QGIS 1.7) cannot be saved as shapefile if the joined table contains field names longer than 10 characters.
In versions <= 1.6, when dynamic attribute join was not possible but joining attributes was done using fTools by permanently saving into a new dataset, field names longer than 10 characters would just be truncated.
It would be nice if this behaviour was re-introduced for the dynamic table join
#1 Updated by bnotter - over 9 years ago
Sorry, my observation on this bug was not correct:
The problem is not, as described above, that too long field names are not truncated, but that if they are truncated, they may not be unique anymore. This in itself is not a bug but expected behavior.
However, what could be expected is that if tables are joined, the resulting combined attribute table would not contain both the join field in the joined table AND the target field in the layer it is joined to, but only one of them (since both contain the same information anyway). Because often, the join field and the target field are named the same. If that is the case, the resulting combined attribute table cannot be exported, and this will force the user to rename one of the fields and set up the join afresh.
I would therefore propose to only keep the target field in the resulting combined table in order to avoid this problem.
I'm also changing the priority of this bug down to "minor: annoyance".