From 8210bfe8c363909866c550082370e933146eebe7 Mon Sep 17 00:00:00 2001 From: rldhont Date: Fri, 6 Dec 2024 17:41:55 +0100 Subject: [PATCH] [Bugfix] Project abstract has to be a string for nl2br and strip_tags Abstract has to be a string ``` [8192] strip_tags(): Passing null to parameter #1 ($string) of type string is deprecated /srv/lzm/temp/lizmap/www/compiled/templates/modules/view/view_html_t_15.php 41 /index.php/view/ array ( \'module\' => \'view\', \'action\' => \'default:index\', ) ref:Unknown referer 0 strip_tags() /srv/lzm/temp/lizmap/www/compiled/templates/modules/view/view_html_t_15.php : 41 1 template_97ecf81651077e876942eb1c8b4df3b8() /srv/lzm/lizmap/vendor/jelix/castor/lib/Castor/CastorCore.php : 290 2 Jelix\\Castor\\CastorCore->_fetch() /srv/lzm/lizmap/vendor/jelix/jelix/lib/jelix/tpl/jTpl.class.php : 181 3 jTpl->fetch() /srv/lzm/lizmap/vendor/jelix/jelix/lib/jelix/utils/jZone.class.php : 287 4 jZone->_createContent()\t/srv/lzm/lizmap/vendor/jelix/jelix/lib/jelix/utils/jZone.class.php : 217 5 jZone->getContent()\t/srv/lzm/lizmap/vendor/jelix/jelix/lib/jelix/utils/jZone.class.php : 373 6 jZone::_callZone()\t/srv/lzm/lizmap/vendor/jelix/jelix/lib/jelix/utils/jZone.class.php : 114 7 jZone::get() /srv/lzm/lizmap/vendor/jelix/jelix/lib/jelix/tpl/jTpl.class.php : 52 8 jTpl->assignZone() /srv/lzm/lizmap/modules/view/controllers/default.classic.php : 157 9 defaultCtrl->index()\t/srv/lzm/lizmap/vendor/jelix/jelix/lib/jelix/core/jCoordinator.class.php : 266 10 jCoordinator->process() /srv/lzm/lizmap/www/index.php : 23 [8192]\tnl2br(): Passing null to parameter #1 ($string) of type string is deprecated /srv/lzm/lizmap/vendor/jelix/castor/lib/plugins/html/modifier.nl2br.php 26 /index.php/view/\n array ( \'module\' => \'view\', \'action\' => \'default:index\', ) ref:Unknown referer 0 nl2br() /srv/lzm/lizmap/vendor/jelix/castor/lib/plugins/html/modifier.nl2br.php : 26 1 jtpl_modifier_html_nl2br() /srv/lzm/temp/lizmap/www/compiled/templates/modules/view/view_html_t_15.php : 86 2 template_97ecf81651077e876942eb1c8b4df3b8() /srv/lzm/lizmap/vendor/jelix/castor/lib/Castor/CastorCore.php : 290 3 Jelix\\Castor\\CastorCore->_fetch() /srv/lzm/lizmap/vendor/jelix/jelix/lib/jelix/tpl/jTpl.class.php : 181 4 jTpl->fetch() /srv/lzm/lizmap/vendor/jelix/jelix/lib/jelix/utils/jZone.class.php : 287 5 jZone->_createContent() /srv/lzm/lizmap/vendor/jelix/jelix/lib/jelix/utils/jZone.class.php : 217 6 jZone->getContent() /srv/lzm/lizmap/vendor/jelix/jelix/lib/jelix/utils/jZone.class.php : 373 7 jZone::_callZone() /srv/lzm/lizmap/vendor/jelix/jelix/lib/jelix/utils/jZone.class.php : 114 8 jZone::get() /srv/lzm/lizmap/vendor/jelix/jelix/lib/jelix/tpl/jTpl.class.php : 52 9 jTpl->assignZone() /srv/lzm/lizmap/modules/view/controllers/default.classic.php : 157 10 defaultCtrl->index()\t/srv/lzm/lizmap/vendor/jelix/jelix/lib/jelix/core/jCoordinator.class.php : 266 11 jCoordinator->process()\t/srv/lzm/lizmap/www/index.php : 23 ``` --- lizmap/modules/lizmap/lib/Project/ProjectMainData.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lizmap/modules/lizmap/lib/Project/ProjectMainData.php b/lizmap/modules/lizmap/lib/Project/ProjectMainData.php index edec65a9c..74f4283f5 100644 --- a/lizmap/modules/lizmap/lib/Project/ProjectMainData.php +++ b/lizmap/modules/lizmap/lib/Project/ProjectMainData.php @@ -547,13 +547,13 @@ protected function readCachedData($cachedData, $requiredTargetLwcVersion, $appCo ); $qgisCachedData = $cachedData['qgis']['data']; - if (array_key_exists('title', $qgisCachedData)) { + if (array_key_exists('title', $qgisCachedData) && !is_null($qgisCachedData['title'])) { $data['title'] = $qgisCachedData['title']; } - if (array_key_exists('abstract', $qgisCachedData)) { + if (array_key_exists('abstract', $qgisCachedData) && !is_null($qgisCachedData['abstract'])) { $data['abstract'] = $qgisCachedData['abstract']; } - if (array_key_exists('keywordList', $qgisCachedData)) { + if (array_key_exists('keywordList', $qgisCachedData) && !is_null($qgisCachedData['keywordList'])) { $data['keywordList'] = $qgisCachedData['keywordList']; }