MerginMaps / MerginMaps/mobile

Error when taking/selecting photo if Attachment widget default path is set via input field instead of expression builder

Open
#4,418 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug forms
Dominant language
C++
Stars
388
Forks
87
Avg merge
2d 7h
Merged PRs (30d)
20

Description

**Description**

When the `Default path` of an Attachment widget is set by typing directly into the input field in QGIS (instead of using the **Edit** option / expression builder), the expression is not activated. Opening such a project in the Mergin Maps mobile app and trying to attach a photo (from camera or gallery) results in an error.

The QGIS plugin correctly warns about this misconfiguration in the Project Status (Sync) dialog:
> *"The attachment widget of the 'photo' field specifies a custom folder, but the default path expression is not activated. Photos taken with the app might not be synced. Activate the expression or learn more."*

This warning is expected behaviour. The bug is that the app returns an error rather than handling this gracefully (e.g. falling back to the default location or showing a clear user-facing message).

**Environment**
[ ] Staging [x] PROD

**Application (+ app version, build, operating system)**
- Mergin Maps mobile 2026.1.2
- iOS 26.0
- QGIS 3.44.7-Solothurn
- Mergin Maps Plugin build: d-137311

**Steps to reproduce**
1. In QGIS, create a project with a survey layer containing a photo field using the Attachment widget
2. Set the `Default path` by **typing directly into the input field** (e.g. `@project_folder + '/photos'`) — do **not** use the Edit... option / expression builder
3. Save and sync the project to Mergin Maps
4. Open the project in the Mergin Maps mobile app
5. Create a new feature and attach a photo (from camera or gallery)

**Actual results**

An error is shown when trying to take or select a photo.

**Expected results**

The app should either save the photo to the default location with a warning, or display a clear and actionable error message explaining that the default path expression is not activated.

**Screenshots or logs**

*Conclusion*
*Created by Claude and supervised by a human test analyst.*

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the attachment flow using a project whose Default path was typed directly rather than activated through the expression builder, then trace the mobile photo handling path for camera and gallery uploads. Confirm whether completion should use the default location or show an actionable configuration error, and verify that the chosen behavior replaces the current error.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, ios
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.