From 4ea47d221f81ecfb923d632d816cb389a1db5e24 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 7 Feb 2012 01:33:53 +0800 Subject: [PATCH] Fix: hook problem --- htdocs/comm/propal.php | 2 +- htdocs/core/class/hookmanager.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 041fbadaead..fdef6ecb390 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -1471,7 +1471,7 @@ if ($id > 0 || ! empty($ref)) // Other attributes $parameters=array('colspan' => ' colspan="3"'); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook - if (empty($reshook)) + if (empty($reshook) && ! empty($extrafields->attribute_label)) { foreach($extrafields->attribute_label as $key=>$label) { diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index 3babbc8aeee..9acad8b7466 100755 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -148,7 +148,7 @@ class HookManager $var=!$var; // Hooks that return int - if (($method == 'doActions' || $method='formObjectOptions') && method_exists($actioninstance,$method)) + if (($method == 'doActions' || $method == 'formObjectOptions') && method_exists($actioninstance,$method)) { $resaction+=$actioninstance->$method($parameters, $object, $action, $this); // $object and $action can be changed by method ($object->id during creation for example or $action to go back to other action for example) if ($resaction < 0 || ! empty($actioninstance->error) || (! empty($actioninstance->errors) && count($actioninstance->errors) > 0))