3liz / lizmap-web-client

Transfer a QGIS project on a server, Lizmap is providing the web interface to browse it
https://www.lizmap.com
Mozilla Public License 2.0
252 stars 141 forks source link

Issue when loading a project having several dot in the filename #2353

Closed laurentj closed 1 year ago

laurentj commented 3 years ago

What is the bug?

We have a tests.cats.qgs project and the lizmap file tests.cats.qgs.cfg

When opening the project we got these errors in the logs:

 The QGIS project data/qgis/tests_projects/test.qgs does not exist!
  lizmap/modules/lizmap/lib/Project/Project.php     206
 index.php/view/media/illustration?repository=test1&project=test.cats
 array (   'repository' => 'test1',   'project' => 'test.cats',   'module' => 'view',   'action' => 'media:illustration', )
 ref:https://xxxxxxxx/index.php/view/

        0       Lizmap\Project\Project->__construct()  lizmap/modules/lizmap/lib/Project/Repository.php : 207
        1       Lizmap\Project\Repository->getProject() lizmap/modules/lizmap/classes/lizmapRepository.class.php : 124
        2       lizmapRepository->getProject() lizmap/modules/lizmap/classes/lizmap.class.php : 374
        3       lizmap::getProject()   lizmap/modules/view/controllers/media.classic.php : 229
        4       mediaCtrl->illustration()      lib/jelix/core/jCoordinator.class.php : 225
        5       jCoordinator->process() index.php : 23

I guess that the key given to Repository is not well formed : the filename is probably cut at the first dot, instead of the last dot.

Steps to reproduce the issue

  1. Install a project having two dots in the name into lizmap
  2. open the project into lizmap
  3. error 500, with the error into var/log/errors.log

Expected behavior

No error 500. And the "key" should be "tests.cat" instead of "tests".

Environment

Gustry commented 2 years ago

Linked to #2020, I can add a check in Lizmap plugin for multiple dots, similar to what have been done for spaces in filename. Do we want the same ?

CF commit in the plugin https://github.com/3liz/lizmap-plugin/commit/32e049fd7996bc24ad0730dbbb7b287e23489f9f