From da0daa49da8d0c64d05c832f07ae3d1cabd2d901 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Thu, 9 Feb 2023 18:01:59 +0100 Subject: [PATCH] FIX: some more PHP8 comptability fixes --- htdocs/core/class/html.formfile.class.php | 8 ++++---- .../triggers/interface_50_modAgenda_ActionsAuto.class.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 4bcf742d461..1d6a2b10a04 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -496,6 +496,10 @@ class FormFile $titletoshow = ($title == 'none' ? '' : $title); } + $addcolumforpicto = ($delallowed || $printer || $morepicto); + $colspan = (4 + ($addcolumforpicto ? 1 : 0)); + $colspanmore = 0; + // Show table if ($genallowed) { $modellist = array(); @@ -747,10 +751,6 @@ class FormFile $out .= ''; - $addcolumforpicto = ($delallowed || $printer || $morepicto); - $colspan = (4 + ($addcolumforpicto ? 1 : 0)); - $colspanmore = 0; - $out .= ''; // Model diff --git a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php index d441d364f4b..ba9cdba1493 100644 --- a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php +++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php @@ -1059,7 +1059,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $ret = $actioncomm->create($user); // User creating action if ($ret > 0 && !empty($conf->global->MAIN_COPY_FILE_IN_EVENT_AUTO)) { - if (is_array($object->attachedfiles) && array_key_exists('paths', $object->attachedfiles) && count($object->attachedfiles['paths']) > 0) { + if (property_exists($object, 'attachedfiles') && is_array($object->attachedfiles) && array_key_exists('paths', $object->attachedfiles) && count($object->attachedfiles['paths']) > 0) { foreach ($object->attachedfiles['paths'] as $key => $filespath) { $srcfile = $filespath; $destdir = $conf->agenda->dir_output.'/'.$ret;