Skip to content

Commit

Permalink
[Bugfix] Parsed Layout only if QGIS Server verion >= 3.0
Browse files Browse the repository at this point in the history
Fixed #1144 lizmap master - stop printing
  • Loading branch information
rldhont committed Mar 28, 2019
1 parent 52ae612 commit d7c0754
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lizmap/modules/lizmap/classes/lizmapProject.class.php
Expand Up @@ -977,6 +977,8 @@ protected function readPrintCapabilities($qgsLoad, $cfg)
$rComposers[] = (string) $restrictedComposer;
}
}

$services = lizmap::getServices();
// get composer qg project version < 3
$composers = $qgsLoad->xpath('//Composer');
if ($composers && count($composers) > 0) {
Expand Down Expand Up @@ -1034,7 +1036,6 @@ protected function readPrintCapabilities($qgsLoad, $cfg)
$ptMap['grid'] = 'True';
}
}
$services = lizmap::getServices();
// In QGIS 3.*
// Layout maps now use a string UUID as "id", let's assume that the first map
// has id 0 and so on ...
Expand Down Expand Up @@ -1090,7 +1091,8 @@ protected function readPrintCapabilities($qgsLoad, $cfg)
}
// get layout qgs project version >= 3
$layouts = $qgsLoad->xpath('//Layout');
if ($layouts && count($layouts) > 0) {
if ($layouts && count($layouts) > 0 &&
version_compare($services->qgisServerVersion, '3.0', '>=')) {
foreach ($layouts as $layout) {
// test restriction
if (in_array((string) $layout['name'], $rComposers)) {
Expand Down

0 comments on commit d7c0754

Please sign in to comment.