MerginMaps / MerginMaps/qgis-plugin
Validation: make the warning when using fid for value relation more clear
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 44
- Forks
- 20
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 5
Description
I have a "points" layer and a "types" table, the points layer has a column that references "types" table in its form, using value relation widget:

As this is a bad practice (the fids in "types" may change), the plugin correctly issues a warning in the project status dialog:

Unfortunately it is probably not very clear what's wrong:
1. the warning refers to "types" layer, but in fact the source of the problem is in the value relation widget configuration.
2. there is no explanation why it is wrong, and how to fix it (e.g. a link to documentation)
I think the warning should look more like this:
### points
- Form configuration for column "type_id": value relation widget uses "fid" column from "types" layer as a key, which is a primary key of the table. The primary key of tables may sometimes change when syncing, so it is discouraged to use them to avoid data loss. The recommended solution is to use another column with auto-assigned UUID values. [Learn more]
For "learn more", we already have some documentation - https://merginmaps.com/docs/layer/attach-multiple-photos-to-features/ - but a dedicated page (maybe unrelated to photos) would be even better.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in the project status dialog where the value relation widget validation warning for fid keys is shown, then trace how it identifies the affected layer and column. Compare the current warning with the proposed points/type_id wording and the linked Mergin Maps documentation; done means the warning explains the risk, suggests UUIDs, and provides useful documentation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation, frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100