Skip to content

Add condition so readOnly child cannot be added from parent - #4688

Open
xkello wants to merge 1 commit into
masterfrom
bugfix/remove-add-button-for-readonly-children
Open

Add condition so readOnly child cannot be added from parent#4688
xkello wants to merge 1 commit into
masterfrom
bugfix/remove-add-button-for-readonly-children

Conversation

@xkello

@xkello xkello commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

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.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.

Linked feature list - child layer

image image


Photo gallery - child layer

image image

@xkello
xkello requested a review from Withalion August 28, 2026 14:23
@github-actions

Copy link
Copy Markdown

Coverage Report for CI Build 33178870626

Coverage decreased (-0.04%) to 59.55%

Details

  • Coverage decreased (-0.04%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 7 coverage regressions across 1 file.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

7 previously-covered lines in 1 file lost coverage.

File Lines Losing Coverage Coverage
mm/core/merginapi.cpp 7 74.79%

Coverage Stats

Coverage Status
Relevant Lines: 15723
Covered Lines: 9363
Line Coverage: 59.55%
Coverage Strength: 94.18 hits per line

馃挍 - Coveralls

@github-actions

Copy link
Copy Markdown

馃摝 Build Artifacts Ready

OS Status Build Info Workflow run
macOS Build 馃摤 Mergin Maps 72461 dmg Expires: 26/11/2026 #7246
linux Build 馃摤 Mergin Maps 72721 x86_64 Expires: 26/11/2026 #7272
win64 Build 馃摤 Mergin Maps 64481 win64 Expires: 26/11/2026 #6448
Android Build 馃摤 Mergin Maps 855611 APK [armeabi-v7a] Expires: 26/11/2026 #8556
馃摤 Mergin Maps 855611 APK [armeabi-v7a] Google Play Store #8556
Android Build 馃摤 Mergin Maps 855651 APK [arm64-v8a] Expires: 26/11/2026 #8556
馃摤 Mergin Maps 855651 APK [arm64-v8a] Google Play Store #8556
iOS Build 馃摤 Build number: 26.08.949811 #9498

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Relations always show the "+" button even when the child table is read-only (as defined in the QGIS project properties) or a view

1 participant