From 660f887d3cc00df4a0293fc0b1c2d3de4bfd0331 Mon Sep 17 00:00:00 2001 From: Nicolas Domenech Date: Tue, 21 May 2024 17:04:20 +0200 Subject: [PATCH] #1810 [Survey] fix: fatal missing check nbLinkableElements --- view/survey/survey_list.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/view/survey/survey_list.php b/view/survey/survey_list.php index 207671c2..6dab8a3e 100644 --- a/view/survey/survey_list.php +++ b/view/survey/survey_list.php @@ -135,7 +135,8 @@ $linkableElements = get_sheet_linkable_objects(); -$objectPosition = 20; +$nbLinkableElements = 0; +$objectPosition = 20; foreach($linkableElements as $linkableElementType => $linkableElement) { $className = $linkableElement['className']; @@ -154,6 +155,7 @@ $elementElementFields[$linkableElement['post_name']] = $linkableElement['link_name']; $linkNameElementCorrespondence[$linkableElement['link_name']] = $linkableElement; $objectPosition++; + $nbLinkableElements++; if (!empty($fromtype)) { $objectLinked = new $className($db); @@ -286,7 +288,16 @@ saturne_banner_tab($objectLinked, 'fromtype=' . $fromtype . '&fromid', '', 1, 'rowid', ($fromtype == 'productbatch' ? 'batch' : 'ref')); } -require_once __DIR__ . '/../../core/tpl/digiquali_survey_list.tpl.php'; +if ($nbLinkableElements == 0) { + print '
'; + print ''; + print '
'; +} else { + require_once __DIR__ . '/../../core/tpl/digiquali_survey_list.tpl.php'; +} // End of page llxFooter();