Fix : bad call of extrafields into categories

This commit is contained in:
jfefe 2014-04-25 14:28:22 +02:00
parent afaf5698a5
commit b2b8fbb227

View File

@ -31,9 +31,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$langs->load("categories");
$extrafields = new ExtraFields($db);
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
// Security check
$socid=GETPOST('socid','int');
if (!$user->rights->categorie->lire) accessforbidden();
@ -64,6 +61,9 @@ if ($catorigin && $type == 0) $idCatOrigin = $catorigin;
$object = new Categorie($db);
$extrafields = new ExtraFields($db);
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
/*
* Actions
*/
@ -244,7 +244,7 @@ if ($user->rights->categorie->creer)
print '<tr><td>'.$langs->trans("AddIn").'</td><td>';
print $form->select_all_categories($type, $catorigin);
print '</td></tr>';
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
if (empty($reshook))
{