You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The "add" button for relation-linked child features (photo gallery tiles and relation bubbles) was shown based only on the user's project role, without checking whether the underlying child layer itself was read-only. This allowed users to attempt adding features to layers that were explicitly configured as read-only in the QGIS project.
Extended the visibility condition for the add button in MMFormGalleryEditor.qml and the add relation button in MMFormRelationEditor.qml to also check rmodel.layer.readOnly, so the add button is hidden whenever the child layer is marked read-only, regardless of project role.
Behavior
When the child layer is read-only, the add button is hidden and only existing linked child features remain visible. When the child layer is editable, the add button is shown as before (subject to the existing project role check). See attached screenshots for both editors, each with a read-only and non-read-only comparison alongside the corresponding QGIS layer settings.
Looks like it doesn't work for new features correctly:
Screencast_20260904_161729.mp4
The survey layer can link both photo and non-spatial layer. Non-spatial layer can also link photo layer. Non-spatial layer is set to be read only. It's possible to open the form of new feature for non-spatial layer, but impossible to save. When opening the for for non-spatial feature there is a visible switch between gallery and relation editor.
Setup:
Project: tester-ws-1/tc05_photo_relations Child layers photos_nogallery and photos_gallery are non-spatial and both set to Read-only Parent layer: Survey_points.
Scenario 1 — creating a new parent feature: ✅ Works as expected.
When creating a new feature in Survey_points, the Add button for child features is correctly not shown for either photos_nogallery or photos_gallery — no way to add a child feature to a read-only layer.
Scenario 2 — editing an existing parent feature: 🔴
When editing an existing Survey_points feature, the Add button is also not shown by default for photos_nogallery — consistent with Scenario 1.
However, clicking directly on the child feature list area activates the Add button, and a new child feature can then be created. Attempting to save this new feature fails ("saving mode was not working").
Result: Partially fixed. The fix correctly hides the Add button for read-only child layers when creating a new parent feature, but the check is inconsistent when editing an existing parent feature — the Add button can still be triggered via the child feature list area, letting the user start creating a child feature that then cannot be saved.
Tested on:
iPhone 15, iOS 26
Samsung Galaxy A53, Android 16
Desktop application
Retested with the read-only child layer configuration:
Result: Fixed. The read-only check now works the same way when creating a new parent feature and when editing an existing one. It's no longer possible to start creating a child feature that can't be saved.
✅Scenario 1 — creating a new parent feature: - Works as expected.
✅Scenario 2 — editing an existing parent feature:
When editing an existing Survey_points feature, the Add button is not shown for photos_nogallery,
The reason will be displayed to describe this comment to others. Learn more.
Isn't this done directly within the setup method that is called on the line below?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The "add" button for relation-linked child features (photo gallery tiles and relation bubbles) was shown based only on the user's project role, without checking whether the underlying child layer itself was read-only. This allowed users to attempt adding features to layers that were explicitly configured as read-only in the QGIS project.
Fixes: #4640
What changed
Extended the visibility condition for the add button in
MMFormGalleryEditor.qmland the add relation button inMMFormRelationEditor.qmlto also checkrmodel.layer.readOnly, so the add button is hidden whenever the child layer is marked read-only, regardless of project role.Behavior
When the child layer is read-only, the add button is hidden and only existing linked child features remain visible. When the child layer is editable, the add button is shown as before (subject to the existing project role check). See attached screenshots for both editors, each with a read-only and non-read-only comparison alongside the corresponding QGIS layer settings.
Linked feature list - child layer
Photo gallery - child layer