Disable "Attach a file"-Button in QField attribute dialog

Hello,

I’m looking for help with a problem I encountered after QField updated on the 3.3 Version.

In QGIS (3.22.10-Białowieża), I have a point layer with attached pdf-files. The individual document path for each feature is stored in an attribute field which is set to widget type “attachment”. When I export my QGIS Project for QField, I copy the pdf directory and the pointlayer (shp) to my device via QFieldSync. I cannot use the QFieldCloud opion, I only use cable export. Since the document path in the attachment is set to “relative to project path” it works fine that I get a clickable link to my pdf file in the attribute dialogue of the point feature in QField.

Problem:

Since the 3.3 update for QField, I get an automatically generated button “Attach a file” in the attribute field with the attachment.
In my work context, the QField users are not meant to attach a new file in the field. On the contrary, it is important that there are no accidental changes to the original attachment, that I created when setting up the QGIS project. The users simply should be able to access the attached pdf-file through the clickable link. Since the button also overlays the link, it is highly probable that my QField users accidentally click the “Attach a file”-button. I therefore want to completely loose the button.

(Screenshot QField)

Attempts to fix problem:

I tried every setting that I know of to disable this button and to prevent any unwanted changes on the feature attributes.

  • In the widget-options, I made the widget non-editable and disabled the checkbox “Display button to open dialog”.
  • Additionally I made the whole layer “read-only” in the Data Sources Options in the project properties.
  • In the QField export settings I locked the geometries of the layer.

(Screenshot Widget Settings QGIS)

(Screenshot Project Properties)

When looking at the attribute table in QGIS I don’t see any buttons for file attachment and the layer is protected as read-only.
In QField meanwhile, I still have the “Attach a file” button and what’s worse - it still allows the user to alter the attachment that’s linked to the feature eventhough the layer is protected as read-only.

Does anyone know how I can set QField to how it has been before the update, without the dialog-button?

If you need any additional info to help me in this case just let me know.
Thank you very much!


Imported from GitHub discussion by @Rinn37 on 2024-09-12T09:30:04Z

Rinn37 , can you share a sample project? I can’t replicate here.


Imported from GitHub comment by @nirvn on 2024-09-17T03:10:21Z

nirvn, thanks for your response. I made a sample project with a point layer containing one feature linked to a pdf-dummy. Both the pdf directory and the qfield export are included in the .zip-file below.

Sample_Project_QField_Attachment.zip

I still have the same issue - in QGIS everything works fine - in QField the “select-a-file” dialog overlaps the actual pdf link. And I can’t find a way to get rid of the dialog button.

The problem started when I updated on QField 3.3. In the former version, using the very same QGIS-export, there was no option to select a file in the attachment field.

Thanks for your help!
Rinn37


Imported from GitHub comment by @Rinn37 on 2024-09-26T13:32:57Z

Rinn37 , I think this will be fixed in the latest QField release (3.4.2), give it a try.


Imported from GitHub comment by @nirvn on 2024-09-29T10:14:48Z

nirvn You were right, the problem is fixed in 3.4.2. Thanks for your help!


Imported from GitHub comment by @Rinn37 on 2024-10-01T08:21:28Z