Bug report #8939
Atlas Feature Sorting
|Affected QGIS version:||2.0.1||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||worksforme|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||17607|
I am using the "Atlas generation" feature of the QGIS print composer. It seems that the "Feature sorting" value is not remembered when a QGIS file is closed and re-opened. For example, if I sort by a field, "page_name", the PDF pages are correctly ordered by this field when I export them; however, if I close and re-open the document the print composer will return to using the first field as the sort field and the pages in the PDF will be exported in a seemingly random order.
From my limited knowledge of how QGIS works, I suspect the sort order is being saved, but is not being read when QGIS is re-opened. I tested this by opening the .qgs file in a text editor and it seems that the sortKey field is, in fact, saved in the document (for example, if "page_name" was the fifth column, there will be a value of sortKey=4 in the .qgs file). The problem seems to be that this field is not read when a document is re-opened (e.g. it just goes back to using sortKey=0).