Skip to content

Update relation logic to work for composite type as well - #4742

Open
xkello wants to merge 3 commits into
masterfrom
bugfix/fix-composite-relation
Open

xkello wants to merge 3 commits into
masterfrom
bugfix/fix-composite-relation

Conversation

@xkello

@xkello xkello commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes #2315

The app treated every QGIS relation as an association, so deleting a parent never deleted its children. Children added while creating a new parent were also left behind as orphans when that parent was discarded. Relation strength is now read from the QGIS project, and composition relations are respected.

What changed

  • InputUtils::deleteLinkedFeatures() deletes all features linked to a feature, including nested ones. Normally it only follows composition relations, but when a new feature is discarded it follows every relation.
  • InputUtils::hasCompositionChildren() tells whether deleting features would also delete linked features.
  • AttributeController::deleteFeature() and MultiEditManager::deleteSelectedFeatures() delete the linked features first and then continue with their original delete flow.
  • AttributeController::hasCompositionChildren() and MultiEditManager::selectedFeaturesHaveCompositionChildren() drive the confirmation text.
  • MMFormDeleteFeatureDialog.qml gets a deletesLinkedFeatures property that switches to the new description.
  • MMFormPage.qml deletes everything linked to a new feature when it is discarded or deleted in add mode.

Behaviour

  • Composition: deleting a parent also deletes its children, grandchildren and further levels.
  • Association: unchanged, deleting a parent keeps its children.
  • New parent discarded without saving: children created while adding it are deleted, for both strengths.
  • Before deleting a parent with composition children, the dialog says the linked features will also be deleted. This works for one feature and for several selected features.

@xkello
xkello requested a review from Withalion October 6, 2026 15:05
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 37489113905

Warning

No base build found for commit ed851fa on master.
Coverage changes can't be calculated without a base build.
If a base build is processing, this comment will update automatically when it completes.

Coverage: 59.8%

Details

  • Patch coverage: No coverable lines changed in this PR.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

Requires a base build to compare against. How to fix this →


Coverage Stats

Coverage Status
Relevant Lines: 15831
Covered Lines: 9467
Line Coverage: 59.8%
Coverage Strength: 93.81 hits per line

💛 - Coveralls

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown

📦 Build Artifacts Ready

OS Status Build Info Workflow run
macOS Build 📬 Mergin Maps 73871 dmg Expires: 04/01/2027 #7387
linux Build 📬 Mergin Maps 74131 x86_64 Expires: 04/01/2027 #7413
win64 Build 📬 Mergin Maps 65891 win64 Expires: 04/01/2027 #6589
Android Build 📬 Mergin Maps 869911 APK [armeabi-v7a] Expires: 04/01/2027 #8699
📬 QR code Google Play Store #8699
Android Build 📬 Mergin Maps 869951 APK [arm64-v8a] Expires: 04/01/2027 #8699
📬 QR code Google Play Store #8699
iOS Build 📬 Build number: 26.10.963911 #9639

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.

Relationship strength "composite" has no effect in the app

1 participant