From 42aa7a25f904c3ff63a1b9cf073d8e73a314d70c Mon Sep 17 00:00:00 2001 From: Alexis Algoud Date: Fri, 9 Mar 2018 22:54:45 +0100 Subject: [PATCH 1/2] FIX include cache issue --- htdocs/modulebuilder/index.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 3b2e36e21d8..1058f38ffd2 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -490,8 +490,7 @@ if ($dirins && $action == 'addproperty' && !empty($module) && ! empty($tabobj)) setEventMessages($langs->trans('FilesForObjectUpdated', $objectname), null); clearstatcache(true); - sleep(4); // With sleep 2, after the header("Location...", the new page output does not see the change. TODO Why do we need this sleep ? - + // Make a redirect to reload all data header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=objects&module='.$module.'&tabobj='.$objectname.'&nocache='.time()); @@ -526,8 +525,7 @@ if ($dirins && $action == 'confirm_deleteproperty' && $propertykey) setEventMessages($langs->trans('FilesForObjectUpdated', $objectname), null); clearstatcache(true); - sleep(4); // With sleep 2, after the header("Location...", the new page output does not see the change. TODO Why do we need this sleep ? - + // Make a redirect to reload all data header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=objects&module='.$module.'&tabobj='.$objectname); @@ -1550,6 +1548,8 @@ elseif (! empty($module)) print '


'; + opcache_invalidate($dirread.'/'.$pathtoclass,true); // remove the include cache hell ! + if (empty($forceddirread)) { $result = dol_include_once($pathtoclass); From 1d69d8e51ebe6b9e65c0e3f3c7c1325f181ba9b8 Mon Sep 17 00:00:00 2001 From: Alexis Algoud Date: Fri, 9 Mar 2018 23:03:23 +0100 Subject: [PATCH 2/2] add function_exist --- htdocs/modulebuilder/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 1058f38ffd2..dbc69c943dd 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -1548,7 +1548,7 @@ elseif (! empty($module)) print '


'; - opcache_invalidate($dirread.'/'.$pathtoclass,true); // remove the include cache hell ! + if(function_exists('opcache_invalidate')) opcache_invalidate($dirread.'/'.$pathtoclass,true); // remove the include cache hell ! if (empty($forceddirread)) {