MerginMaps / mobile

Mobile app for Mergin Maps 📲. Open QGIS projects and manage vector data on your phone, even offline 📶 (Android/iOS/Windows app)
https://merginmaps.com
GNU General Public License v2.0
280 stars 62 forks source link

Photo renaming does not work when multiple photo fields have custom expressions #3415

Closed raherin closed 1 week ago

raherin commented 1 month ago

I have been able to recreate an issue reported by at least one other user where multiple photo naming expressions are used in 'Project>Properties', only the first listed expression will be applied in the app.

I have a project with two point survey layers. The first survey layer has two photo attachment fields and the second layer has one photo attachment field. In my project directory, I have a 'photos/' folder to store photo attachments. In the project properties, I have a photo naming expression set for each attachment field, the same expression is used for each field:

'photos/'||@mergin_username||'-'||@layer_name||to_string("count")||'_'||format_date("date",'yyyy-MM-dd_Thh.mm.ss')

image

In the app, I add a feature to Survey layer and add two photo attachments Screenshot_20240509_163349

I then add a feature to survey2 layer and add one photo attachment Screenshot_20240509_163428

I then synchronise the changes in the mobile app and go back to sync in QGIS, however I can see that the photo naming expression was only applied to one of the three photos I just recorded in the app

image

If I go to the project directory, I can see that two of the photos did not get saved to the /photos folder and the photo in the Survey.photo field is in the /photos folder with the correctly applied custom name

image

photos/

image
tomasMizera commented 1 month ago

@raherin can you share the project with us please?

raherin commented 1 month ago

@tomasMizera you can find the project here, I have given you 'Owner' rights to add more users if needed.

jozef-budac commented 4 days ago

@tomasMizera @raherin , can you please share this project with me? I want to verify the fix. Thanks

VitorVieiraZ commented 3 days ago

@tomasMizera @raherin , can you please share this project with me? I want to verify the fix. Thanks

Hi @jozef-budac, I just shared this project with you. You can find it here.