Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Specific media destination folder setup does not work #4975

Open
1 task done
meyerlor opened this issue Nov 14, 2024 · 3 comments
Open
1 task done

[Bug]: Specific media destination folder setup does not work #4975

meyerlor opened this issue Nov 14, 2024 · 3 comments
Labels

Comments

@meyerlor
Copy link

meyerlor commented Nov 14, 2024

What is the bug? (in English)

I follow precicely the instructions to setup a "central" media folder which should be shared by different projects. Folder structure on the server is:
grafik

/var/www/cutomerA/lizmap/install/customerA
---ProjectA/ProjectA.qgs
---ProjectB/ProjectB.qgs
---media/Fotos_Spielgerät/69_1.jpg

Permissions are correctly set for www-data.
In ProjectA, the layer "Playground" has a column "Picture_1" and an example attribute is: "Fotos_Spielgerät/69_1.jpg"
grafik

In the layer settings, i set the attribute form widget to "Attachment", default path to ../media/ and "Store Path as Relative to Project Path"
grafik

In the QGIS attribute form it won't show a picture (folder structure is obviously the same as on server), as well as on Lizmap.

Am i missing something or is this a bug?

Steps to reproduce the issue

  1. Configure QGIS
  2. Upload Project
  3. Pictures are not found

Versions, safeguards, check summary etc

Versions :

  • Lizmap Web Client : 3.8.3
  • Lizmap plugin : 4.4.4
  • QGIS Desktop : 3.34.12
  • QGIS Server : 3.34.12
  • Py-QGIS-Server : not used
  • QGIS Server plugin atlasprint : 3.4.1
  • QGIS Server plugin lizmap_server : 2.11.2
  • QGIS Server plugin wfsOutputExtension : 1.8.2
List of Lizmap Web Client modules :
* Version Lizmap Web Client 3.8 needed
List of safeguards :
* Mode : normal
* Allow parent folder : no
* Prevent other drive : yes
* Prevent PG service : yes
* Prevent PG Auth DB : yes
* Force PG user&pass : yes
* Prevent ECW : yes

Check Lizmap plugin

  • I have done the step just before in the Lizmap QGIS desktop plugin before opening this ticket. Otherwise, my ticket is not considered valid and might get closed.

Operating system

Ubuntu 22.04

Browsers

Firefox

Browsers version

Firefox 115

Relevant log output

No response

@meyerlor meyerlor added the bug label Nov 14, 2024
@meyerlor
Copy link
Author

meyerlor commented Nov 14, 2024

After some more trial and lot's of error i'm one step closer to the solution:
The Default Path in the attachment widget needs to be set to: "../media/Spielgerät_Fotos/"
And the attribute in the pictures column need as well to be set to: "media/Spielgerät_Fotos/69_1.jpg".

Only downside now: uploading a picture via LWC sets the attribute to: "../media/Spielgerät_Fotos/MyTestPic.jpg"

Is there any chance to get rid of the ".." ?
I do not really grasp the logic behind that to be honest (seems to be redundand to define the default path and then have in the picture column again the almost relative path..)) - i will try to improve the documentation regarding this with a pull request once i get this riddle solved completely.

@meyerlor meyerlor reopened this Nov 14, 2024
@Gustry
Copy link
Member

Gustry commented Nov 14, 2024

I was going to suggest to "upload a file from LWC and check the path created", so as to upgrade your existing dataset.

Only downside now: uploading a picture via LWC sets the attribute to: "../media/Spielgerät_Fotos/MyTestPic.jpg"

I think it's on purpose. Any downside about this ? I think the logic is to always keep a relative path from the QGIS project.

@meyerlor
Copy link
Author

well, putting it that way it really kind of makes sense - the thing is, i would need it without the leading "../" in order to work with the pictures in other (non LWC) projects (QField Cloud in particular).
And what i'm still wondering about: why does LWC then recognize my preuploaded pictures in the same folder - in the attribute table they are without the leading "../" but still work!

If nothing helps, i'll try it with a PostGres trigger which cleans the leading "../" - would be the least favourable solution, but at least it would be something :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants