From 611bae4c3a2faf41a03fc3ebb474104a6926fe94 Mon Sep 17 00:00:00 2001
From: fr69400 <82267780+fr69400@users.noreply.github.com>
Date: Fri, 10 Dec 2021 14:20:04 +0100
Subject: [PATCH 1/2] FIX - unasigned variable $action given to hook
printOriginObjectSubLine
---
htdocs/core/class/commonobject.class.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index f2471d122af..03a9d518021 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -4855,7 +4855,7 @@ abstract class CommonObject
*/
public function printOriginLinesList($restrictlist = '', $selectedLines = array())
{
- global $langs, $hookmanager, $conf, $form;
+ global $langs, $hookmanager, $conf, $form, $action;
print '
';
print '| '.$langs->trans('Ref').' | ';
From 2419784bdb743efe197745e1876eeb2578cbeb29 Mon Sep 17 00:00:00 2001
From: fr69400 <82267780+fr69400@users.noreply.github.com>
Date: Mon, 13 Dec 2021 16:54:42 +0100
Subject: [PATCH 2/2] Update commonobject.class.php
---
htdocs/core/class/commonobject.class.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 03a9d518021..85fc0922913 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -4881,7 +4881,7 @@ abstract class CommonObject
if (is_object($hookmanager)) { // Old code is commented on preceding line.
$parameters = array('line'=>$line, 'i'=>$i, 'restrictlist'=>$restrictlist, 'selectedLines'=> $selectedLines);
if (!empty($line->fk_parent_line)) { $parameters['fk_parent_line'] = $line->fk_parent_line; }
- $reshook = $hookmanager->executeHooks('printOriginObjectSubLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
+ $reshook = $hookmanager->executeHooks('printOriginObjectLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
}
if (empty($reshook)) {
$this->printOriginLine($line, '', $restrictlist, '/core/tpl', $selectedLines);