Bug report #17412
Failed to rename field to "xxx", is the field name unique
|Affected QGIS version:||master||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:|
|Crashes QGIS or corrupts data:||Yes||Copied to github as #:||25309|
When sorting the rows in the fields tab of the vector layer properties and accepting the dialog, an error message appears, informing about renaming of fields. In fact, there is no intention by anyone to rename a field in such a situation.
Applies to QGIS 2.18 and master.
References #17412 Fixes problem when changeing sort but not when renaming
When sort and then toggle edditing, the problem was that it wanted to rename all the fields
Whis is avoided now by checking the indexes
But still problems open when one wants to rename fields in unsorted layout
Fix #17412 Sorting fixed, no troubles when editing after sorting
Issue was, that the cellchange is triggered at re-sorting - so we need to check the names
Following issue was, that when removing or renaming something in re-sorted table - so there was a bug that referenced to the row instead of the index
Thought about to remove mIndexedWidgets completely, but when renumbering after delete in unsorted table, we cannot reference to the row order.