[Lizmap] conditional forms

michal.wloga at envirosolutions.pl michal.wloga at envirosolutions.pl
Mon May 3 23:25:15 PDT 2021


Hi,

 

I found out that checkbox field always sends to php 'f' value because of

 

$unchecked = (string) ($this->widgetv2configAttr->UncheckedState === '' ?
'f' : $this->widgetv2configAttr->UncheckedState);

 

>From 'fillCheckboxValues' function of 'qgisFormControl.class.php'

 

Unfortunately commenting it out ends with constant response of "0" instead
of 'f'. Does anyone have an idea where to look for a source of this bug?

Regards,

EnviroSolutions Sp. z o. o.
Michał Włoga
tel: +48 607 059 157
coo at envirosolutions.pl <mailto:coo at envirosolutions.pl> 
www.envirosolutions.pl <http://www.envirosolutions.pl/szkolenia> 

 
<https://www.envirosolutions.pl/news/118/129/Wtyczka-QGIS---Pobieracz-Danych
-GUGiK.html> Pobieracz Danych GUGiK - laureat nagrody GUGiK na najlepsze
wykorzystanie danych i usług GUGiK w 2020 r.

 

From: Lizmap [mailto:lizmap-bounces at lists.osgeo.org] On Behalf Of
michal.wloga at envirosolutions.pl
Sent: Friday, April 30, 2021 11:40 AM
To: lizmap at lists.osgeo.org
Subject: [Lizmap] conditional forms

 

Hi devs,

 

I have found some bugs in qgis forms interpretation in Lizmap. It is
connected with LWC and lizmap server plugin and can be fixed in different
ways so I don't know where to post an issue.

 

Context:

I would like to create a form with visibility based on conditions. In QGIS
Desktop everything works correct: via drag and drop forms and groups
visibility based on expression eg. >>"boolfield" = true<<

 

The first problem is with checkbox field (Boolean in postgres). JavaScript
in LWC sends an request to validate an expression with value "f" if
unchecked or "t" if checked. It is forwarded from PHP to lizmap server
plugin and it returns False every time because "t" is not recognized as
"true"

 

The second problem is that when there is an expression error (e.g.
>>"integerfield" % 2 = 0 << and empty string is passed) QGIS Server (via
lizmap plugin) returns "null" but php returns "true" without any notice
about backend error.

 

 

Regards,

EnviroSolutions Sp. z o. o.
Michał Włoga
tel: +48 607 059 157
 <mailto:coo at envirosolutions.pl> coo at envirosolutions.pl
 <http://www.envirosolutions.pl/szkolenia> www.envirosolutions.pl

 
<https://www.envirosolutions.pl/news/118/129/Wtyczka-QGIS---Pobieracz-Danych
-GUGiK.html> Pobieracz Danych GUGiK - laureat nagrody GUGiK na najlepsze
wykorzystanie danych i usług GUGiK w 2020 r.

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/lizmap/attachments/20210504/efff0bd4/attachment.html>


More information about the Lizmap mailing list