diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 1d418ac295c..109746b4e64 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -88,7 +88,7 @@ $extrafields = new ExtraFields($db); $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not includ_once +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('ordercard','globalcard')); diff --git a/htdocs/core/actions_fetchobject.inc.php b/htdocs/core/actions_fetchobject.inc.php index 3014e8652a6..520d3c2d6da 100644 --- a/htdocs/core/actions_fetchobject.inc.php +++ b/htdocs/core/actions_fetchobject.inc.php @@ -28,7 +28,7 @@ // $cancel must be defined // $id or $ref must be defined (object is loaded in this file with fetch) -if (($id > 0 || ! empty($ref)) && empty($cancel)) +if (($id > 0 || (! empty($ref) && ! in_array($action, array('create','createtask')))) && empty($cancel)) { $ret = $object->fetch($id,$ref); if ($ret > 0) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 1b871136235..3bf17f76a4f 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -77,7 +77,7 @@ $hideref = (GETPOST('hideref','int') ? GETPOST('hideref','int') : (! empty($co $object = new Expedition($db); // Load object. Make an object->fetch -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not includ_once +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('expeditioncard','globalcard')); diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 80d36e7d84d..e62b332e5e0 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -55,7 +55,7 @@ $object = new Project($db); $extrafields = new ExtraFields($db); // Load object -//include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Can use generic include because when creating a project, ref is defined and we dont want error if fetch fails from ref. +//include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Can't use generic include because when creating a project, ref is defined and we dont want error if fetch fails from ref. if ($id > 0 || ! empty($ref)) { $ret = $object->fetch($id,$ref); // If we create project, ref may be defined into POST but record does not yet exists into database diff --git a/htdocs/projet/contact.php b/htdocs/projet/contact.php index dc68dd973c5..d20ad16c9fa 100644 --- a/htdocs/projet/contact.php +++ b/htdocs/projet/contact.php @@ -42,7 +42,7 @@ $mine = GETPOST('mode')=='mine' ? 1 : 0; $object = new Project($db); -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not includ_once +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Security check $socid=0; diff --git a/htdocs/projet/document.php b/htdocs/projet/document.php index b33a7e40287..44332ff558c 100644 --- a/htdocs/projet/document.php +++ b/htdocs/projet/document.php @@ -47,7 +47,7 @@ $result=restrictedArea($user,'projet',$id,''); $object = new Project($db); -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not includ_once +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once if ($id > 0 || ! empty($ref)) { $upload_dir = $conf->projet->dir_output . "/" . dol_sanitizeFileName($object->ref); diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 5ef872e3185..ef3f62d98a2 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -87,7 +87,7 @@ $projectid=$id; // For backward compatibility $object = new Project($db); -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not includ_once +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Security check $socid=0; diff --git a/htdocs/projet/ganttview.php b/htdocs/projet/ganttview.php index b5843feb0a8..4bafee55e82 100644 --- a/htdocs/projet/ganttview.php +++ b/htdocs/projet/ganttview.php @@ -39,7 +39,7 @@ $mine = ($mode == 'mine' ? 1 : 0); $object = new Project($db); -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not includ_once +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Security check $socid=0; diff --git a/htdocs/projet/note.php b/htdocs/projet/note.php index f501f25c866..fe6137223d5 100644 --- a/htdocs/projet/note.php +++ b/htdocs/projet/note.php @@ -37,7 +37,7 @@ $mine = $_REQUEST['mode']=='mine' ? 1 : 0; $object = new Project($db); -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not includ_once +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Security check $socid=0;