lizmap-web-client
lizmap-web-client copied to clipboard
Form filter - Allow to use a second field for the numeric type
It was already possible for dates in the previous versions. Now a second field can also be used for the numeric form widget. It is useful when the layer features contain two fields describing a minimum and maximum value of the same property (ex: age, width, depth, etc.)
Funded by Terre de Provence Agglomération https://www.terredeprovence-agglo.com/
Linked to https://github.com/3liz/lizmap-plugin/pull/442
Ouch in cypress
Undefined array key "metadata"\n /srv/lzm/lizmap/modules/lizmap/lib/Server/Server.php\t56
It seems from my fault ...
Ouch in cypress
Undefined array key "metadata"\n /srv/lzm/lizmap/modules/lizmap/lib/Server/Server.php\t56
It seems from my fault ...
https://github.com/3liz/lizmap-web-client/blob/master/lizmap/modules/lizmap/lib/Server/Server.php#L56
The metadata is empty when it's called.
Ouch in cypress
Undefined array key "metadata"\n /srv/lzm/lizmap/modules/lizmap/lib/Server/Server.php\t56
It seems from my fault ...
https://github.com/3liz/lizmap-web-client/blob/master/lizmap/modules/lizmap/lib/Server/Server.php#L56
The metadata is empty when it's called.
I will check
It seems we must change a little in 3.6 (then use it here) how the full metadata is build and shared by the Server.php
lib.
At present, if you are not logged as an admin, the returned metadata is
{"info":{"version":"3.7.0-pre","date":"2021-07-27"},"dependencies":{"jelix":{"version":"1.8.0-alpha.2","minversion":"1.8.0-alpha.2","maxversion":"1.8.0-alpha.2"}},"qgis_server":{"test":"OK","mime_type":"text\/xml; charset=utf-8"},"qgis_server_info":{"error":"NO_ACCESS"}}
There is a rule here: https://github.com/3liz/lizmap-web-client/blob/master/lizmap/modules/lizmap/lib/Server/Server.php#L157
which explains this response.
I think the class Server
should not consider if the user is logged or not but always return the full metadata. The controller(s) should do the check:
- in the admin project page, no worries, no check
- for the "map page", in the
lizMap.classic.php
the metadata object is only used for access control (I think but have not checked). If so, no worries, no check - for the view/app/metadata (the source of the JSON downloaded by the Lizmap plugin) -> the controller should also check and remove the sensitive data if the user is not an administrator. Before returning the metadata, remove sensitive properties: https://github.com/3liz/lizmap-web-client/blob/master/lizmap/modules/view/controllers/app.classic.php#L32
@rldhont gentle ping
@mdouchin LGTM but a test could be added.
If it is ok for you, I propose we add JS test after your PR #3073 with a test infrastructure will be merged