Skip to content

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

@RastoHu

Description

@RastoHu

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugformsrelated to attribute forms

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions