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]: Default values does not work in edition form when using overlay_contains #4830

Closed
1 task done
vlebert opened this issue Oct 2, 2024 · 6 comments
Closed
1 task done
Labels
bug editing form feedback stale This ticket might be closed soon

Comments

@vlebert
Copy link

vlebert commented Oct 2, 2024

What is the bug? (in English)

I have an edition form valid in QGIS where the default value of a given field is calculated with this QGIS formula:

concat(
array_to_string(array_distinct(array_cat(overlay_contains('t_adresse_8a01a16e_9319_4737_b06e_dbc3c0b9e51d',expression:=ad_code,limit:=-1),overlay_contains('t_adresse_a5e83ddd_a3a9_4405_ac48_64b82d9245df',expression:=ad_code,limit:=-1), overlay_contains('t_adresse_2023_f1910257_f166_45a3_8af4_8639ad110a25',expression:=ad_code,limit:=-1)))))

This does not work in Lizmap when client

Steps to reproduce the issue

Make a prefilled field based on overlay_contains formulas

Versions, safeguards, check summary etc

Versions :

  • Lizmap Web Client : 3.7.10
  • Lizmap plugin : 4.4.0
  • QGIS Desktop : 3.34.6
  • Lizmap.com : Yes
  • QGIS Server : 3.34.11
  • Py-QGIS-Server : 1.8.8
  • QGIS Server plugin atlasprint : 3.4.1
  • QGIS Server plugin cadastre : 1.20.0
  • QGIS Server plugin lizmap_server : 2.10.1
  • QGIS Server plugin wfsOutputExtension : 1.8.2
List of safeguards :
  • Mode : normal
  • Allow parent folder : no
  • Prevent other drive : yes
  • Prevent PG service : no
  • 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

Lizmap hosted

Browsers

Chrome

Browsers version

129.0.6668.71

Relevant log output

No response

@Gustry
Copy link
Member

Gustry commented Oct 2, 2024

Can you add more context ? Is the expression evaluated as soon as you open the form in QGIS ? Or after some values in the form ? Maybe with the field ad_code ? Or is a static expression ?

Is-it on feature creation or modification ?

Related to #3226 ?

@Gustry Gustry added the feedback label Oct 2, 2024
@vlebert
Copy link
Author

vlebert commented Oct 2, 2024

Does this help ?
It does not work on feature creation in Lizmap while it works in QGIS

Yes it is evaluated as soon as the form is opened in QGIS

digi-studio 2024-10-02 at 14 44 05

@Gustry
Copy link
Member

Gustry commented Oct 2, 2024

Before opening your form in Lizmap, can you open your "developer tools" F12, and see if there is an HTTP requests when you open the form ? In the "Network" tab. There is one HTTP request for the form itself and another one for expressions I think

@vlebert
Copy link
Author

vlebert commented Oct 3, 2024

hi @Gustry

Here is a screenshot. But I don't see any interesting information here. Would you like more detail

I think the issue is that the form pops up before geometry drawing. That mean the formula can't be evaluated.

I tried keeping the default value formula in QGIS but removing the field from the edit form, but same results

bug lizmap form create

digi-studio 2024-10-03 at 09 49 31

@Gustry
Copy link
Member

Gustry commented Oct 3, 2024

I think the issue is that the form pops up before geometry drawing. That mean the formula can't be evaluated.

Yes, this is definetely a blocker.
In QGIS, we first click on the map, then the form opens.
In Lizmap, it's the reverse, the form opens and then we can click on the map.

So you can look at the ticket mentioned earlier #3226 it's a "metaticket" now, there a few cases of expressions to work on.

Copy link

github-actions bot commented Nov 4, 2024

This issue is missing some feedbacks. 👻
Please have a look to the discussion, thanks. 🦎

@github-actions github-actions bot added the stale This ticket might be closed soon label Nov 4, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug editing form feedback stale This ticket might be closed soon
Projects
None yet
Development

No branches or pull requests

2 participants