Fix: hook problem

This commit is contained in:
Regis Houssin 2012-02-07 01:33:53 +08:00
parent fc3fefee6c
commit 4ea47d221f
2 changed files with 2 additions and 2 deletions

View File

@ -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)
{

View File

@ -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))