diff --git a/lizmap/modules/lizmap/classes/lizmapProject.class.php b/lizmap/modules/lizmap/classes/lizmapProject.class.php index d16d9a5eb1..338f167d3a 100644 --- a/lizmap/modules/lizmap/classes/lizmapProject.class.php +++ b/lizmap/modules/lizmap/classes/lizmapProject.class.php @@ -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) { @@ -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 ... @@ -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)) {