Closed CMKMS-LINZ closed 3 years ago
As pointed out this is a deviation from expected behavior.
As a first step, source code is to be reviewed as to understand how this has been introduced and it complexity. A solutions should be tabled
I have altered src code so that the QGIS native actionAddFeature returns errors when no layer or non relevent layer is selected when using the Create feature geometry Gazetteer tool.
As the QGIS3 actionAddFeature
API is different than QGIS2 behavior does differ but errors are raised to adds the scenarios when no layer is selected and when the layers is not a Gazetteer feature layer.
No layer selected when using the Create feature geometry Gazetteer tool: "Add feature: No active vector layer" info warning is displayed
Non Gazetteer feature layer selected when using the Create feature geometry Gazetteer tool: "Add feature: Layer not editable" info warning is displayed
If either the layer Gazetteer feature refpt or Gazetteer feature point is selected, in both instances it will let you create new points (the later layer being the relevant one). In both cases in only creates new points under Gazetteer feature point.
This is acceptable - As the database only allows one reference point, presumably it would be more obvious if it were trying to create a second reference point (eg would crash)
It also does seem to hook into QGIS geometry tools, eg, you can use the Gazetteer tool to add geometry to a non gazetteer layer that is editable.
Bug Description
In production plugin 1.8.1, if no vector layer is selected, then the 'New feature geometries' tool is selected, and somewhere clicked, nothing happens. If any layer in the layer tree other than the Gazetteer feature layers is selected, an error message is thrown up (see test plan 3 step 10).
In plugin 2.0.1 UAT, if either no vector layer, or any random vector layer is selected, and then 'New feature geometries' tool is selected, and somewhere in the map window clicked, it turns on editing for the active layers, defaulting to creating a New Feature point geometry creation at the position.
This difference gives a small risk of inadvertent extra reference points being added to names.
Steps to Reproduce
See above
Desktop
Screenshots