From 01ad3d98b703c04f0b206d85dd79c5a7edc91781 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 14 Oct 2022 10:55:14 +0200 Subject: [PATCH] fix warning --- htdocs/core/class/commonobject.class.php | 23 ++++++++++++++--------- htdocs/core/class/html.form.class.php | 2 +- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 508129ba141..3bd6991feac 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4917,15 +4917,18 @@ abstract class CommonObject // Note: This is deprecated. If you need to overwrite the tpl file, use instead the hook. $dirtpls = array_merge($conf->modules_parts['tpl'], array($defaulttpldir)); foreach ($dirtpls as $module => $reldir) { + $res = 0; if (!empty($module)) { $tpl = dol_buildpath($reldir.'/objectline_title.tpl.php'); } else { $tpl = DOL_DOCUMENT_ROOT.$reldir.'/objectline_title.tpl.php'; } - if (empty($conf->file->strict_mode)) { - $res = @include $tpl; - } else { - $res = include $tpl; // for debug + if (file_exists($tpl)) { + if (empty($conf->file->strict_mode)) { + $res = @include $tpl; + } else { + $res = include $tpl; // for debug + } } if ($res) { break; @@ -5040,16 +5043,18 @@ abstract class CommonObject // Note: This is deprecated. If you need to overwrite the tpl file, use instead the hook printObjectLine and printObjectSubLine. $dirtpls = array_merge($conf->modules_parts['tpl'], array($defaulttpldir)); foreach ($dirtpls as $module => $reldir) { + $res = 0; if (!empty($module)) { $tpl = dol_buildpath($reldir.'/objectline_view.tpl.php'); } else { $tpl = DOL_DOCUMENT_ROOT.$reldir.'/objectline_view.tpl.php'; } - - if (empty($conf->file->strict_mode)) { - $res = @include $tpl; - } else { - $res = include $tpl; // for debug + if (file_exists($tpl)) { + if (empty($conf->file->strict_mode)) { + $res = @include $tpl; + } else { + $res = include $tpl; // for debug + } } if ($res) { break; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 041f6902040..f2d104368f4 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -8887,7 +8887,7 @@ class Form $form = new Form($this->db); print $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")).' '; } - print ''.price($objp->total_ht).''; + print ''.(isset($objp->total_ht) ? price($objp->total_ht) : '').''; print ''; print ''.$objp->name.''; print '';