Skip to content

Fixed the UI bug not showing already selected entries for the multi select filter#4494

Open
gabriel-bolbotina wants to merge 3 commits into
masterfrom
fix-filtering-value-relation-multiSelect
Open

Fixed the UI bug not showing already selected entries for the multi select filter#4494
gabriel-bolbotina wants to merge 3 commits into
masterfrom
fix-filtering-value-relation-multiSelect

Conversation

@gabriel-bolbotina
Copy link
Copy Markdown
Contributor

@gabriel-bolbotina gabriel-bolbotina commented May 14, 2026

Solved the UI issue described in issue by converting the string values saved in currentValue to numeric ones which are used in Value Relation with AllowMulti option turned on. In this sense, the UI will show the previously selected entries from the Multi select filter.

The other bug mentioned regarding the filter itself will be solved in the QGIS plugin by modifying the template query for Value Relation with AllowMulti on to something like this:
"sql_expression": "(',' || TRIM(\"NAME_OF_FIELD\", '{}') || ',' ) LIKE '%,' || @@value@@ || ',%'" (detailed here)

Once the template query is modified, the existing business logic in the code already handles this type of filtering with "OR" option.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 14, 2026

Coverage Report for CI Build 26116026069

Coverage decreased (-0.1%) to 57.823%

Details

  • Coverage decreased (-0.1%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 23 coverage regressions across 3 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

23 previously-covered lines in 3 files lost coverage.

File Lines Losing Coverage Coverage
mm/core/merginapi.cpp 13 75.07%
mm/core/merginuserauth.cpp 9 68.24%
mm/app/position/providers/simulatedpositionprovider.cpp 1 91.67%

Coverage Stats

Coverage Status
Relevant Lines: 15231
Covered Lines: 8807
Line Coverage: 57.82%
Coverage Strength: 100.27 hits per line

💛 - Coveralls

@github-actions
Copy link
Copy Markdown

📦 Build Artifacts Ready

OS Status Build Info Workflow run
macOS Build 📬 Mergin Maps 68411 dmg Expires: 12/08/2026 #6841
linux Build 📬 Mergin Maps 68591 x86_64 Expires: 12/08/2026 #6859
win64 Build 📬 Mergin Maps 60341 win64 Expires: 12/08/2026 #6034
Android Build 📬 Mergin Maps 815111 APK [armeabi-v7a] Expires: 12/08/2026 #8151
📬 Mergin Maps 815111 APK [armeabi-v7a] Google Play Store #8151
Android Build 📬 Mergin Maps 815151 APK [arm64-v8a] Expires: 12/08/2026 #8151
📬 Mergin Maps 815151 APK [arm64-v8a] Google Play Store #8151
iOS Build Build failed or not found. #9093

Comment on lines +114 to +117
selected = root.currentValue.map( v => {
const n = Number( v )
return isFinite( n ) && String( n ) === v ? n : v
} )
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
selected = root.currentValue.map( v => {
const n = Number( v )
return isFinite( n ) && String( n ) === v ? n : v
} )
selected = root.currentValue.map( v => isFinite( v ) ? Number( v ) : v )

Any reason why this is not enough?

Comment thread app/qml/filters/components/MMFilterDropdownValueRelationInput.qml Outdated
Co-authored-by: Matej Bagar <matej.bagar@lutraconsulting.co.uk>
@github-actions
Copy link
Copy Markdown

📦 Build Artifacts Ready

OS Status Build Info Workflow run
macOS Build 📬 Mergin Maps 68561 dmg Expires: 17/08/2026 #6856
linux Build 📬 Mergin Maps 68741 x86_64 Expires: 17/08/2026 #6874
win64 Build 📬 Mergin Maps 60501 win64 Expires: 17/08/2026 #6050
Android Build 📬 Mergin Maps 816611 APK [armeabi-v7a] Expires: 17/08/2026 #8166
📬 Mergin Maps 816611 APK [armeabi-v7a] Google Play Store #8166
Android Build 📬 Mergin Maps 816651 APK [arm64-v8a] Expires: 17/08/2026 #8166
📬 Mergin Maps 816651 APK [arm64-v8a] Google Play Store #8166
iOS Build Build failed or not found. #9108

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.

Filtering does not work for fields with Value relation with Multiple selections

2 participants