Skip to content

Do not allow edit mode for read-only layers in the feature form #2870

@tomasMizera

Description

@tomasMizera

Our current way of handling read-only layers is not nice.

If a layer is identifiable, but read-only we allow users to preview the feature form. This is ok, but we also allow them to hit edit and change the values of fields.

When a user clicks on save in the form, nothing happens - not even a message. Console prints:

 QGIS Input: Warning: Cannot start editing

When a user tries to delete the feature, we show a generic error window saying "this should not happen normally". In this case the console says:

"2023-10-23T09:36:32.563Z QGIS Input: Warning: Cannot start editing\n"
"2023-10-23T09:36:32.563Z CommitChanges: Failed to commit changes:\nERROR: layer not editable\n"
"2023-10-23T09:36:32.564Z QGIS Input: Warning: Cannot delete feature\n"

Expected behaviour
We need to hide the edit button for features in read-only layers

To consider: how about relations? If the parent layer is read-only, shall we allow hitting the "add" button to add a child feature if the linked layer is editable?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementformsrelated to attribute formsrecordingRecording of data on the mapui/uxRelated to user interface

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions