Bug report #14775
Layer style 'Categorized' ignores default values before saving layer edits
|Affected QGIS version:||2.14.2||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||invalid|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||22732|
To reproduce this issue please create a new PostGIS layer and set a default value for one of the columns. Next, categorize the layer in the 'Layer properties' dialog using the column with the default value. When adding a new feature the default value is ignored before saving the layer edits. Therefore the added feature isn't rendered on the map canvas.
#5 Updated by R. R. over 4 years ago
- File 14775_create_transaction_groups.mp4 added
After enabeling 'Create transaction groups automatically whenever possible (Experimental)' in Settings/Options.../Data Sources some icons ('Save Layer Edits', 'Undo', 'Redo') are not available and 'Show Feature Count' is still not working properly. However, the default value issue seems to be solved.
#8 Updated by Matthias Kuhn over 4 years ago
- Status changed from Reopened to Closed
- Resolution set to invalid
Users do need to activate this option because the value is generated database side and QGIS does not know what postgres will do after saving.
Transactional editing sends the features to postgres just in time and therefore gives faster visual feedback (at the expense of losing undo/redo functionality).
If this is a requirement
- With current master (QGIS 2.16) there is a new option "Evaluate default values" which takes a different approach and already gets default values from the database before saving the feature
- A new feature request could be opened to define default values via an "Expression"