From c03566eb1ce2bf4c1f4ee71d2a46042a3c578f7d Mon Sep 17 00:00:00 2001 From: Erik Amaru Ortiz Date: Thu, 22 Dec 2011 10:39:01 -0400 Subject: [PATCH] BUG 8224 "Al crear un nuevo trigger salen warnings" SOLVED - when looping for add and register pmfunction classes like zimbra and others a directory was trying to read as file, so validating that the problem is fixed --- .../engine/classes/class.triggerLibrary.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/workflow/engine/classes/class.triggerLibrary.php b/workflow/engine/classes/class.triggerLibrary.php index 99ad48959..6da1845c4 100755 --- a/workflow/engine/classes/class.triggerLibrary.php +++ b/workflow/engine/classes/class.triggerLibrary.php @@ -34,22 +34,25 @@ class triggerLibrary { $aAvailablePmFunctions = $oPluginRegistry->getPmFunctions (); foreach ( $aAvailablePmFunctions as $key => $class ) { $filePlugin = PATH_PLUGINS . $class . PATH_SEP . 'classes' . PATH_SEP . 'class.pmFunctions.php'; - if (file_exists ( $filePlugin )) + + if ( file_exists($filePlugin) && !is_dir($filePlugin)) { $this->registerFunctionsFileToLibrary ( $filePlugin, "ProcessMaker Functions" ); + } } } //Add External Triggers - $dir=G::ExpandPath( "classes" ).'triggers'; - $filesArray=array(); + $dir = G::ExpandPath( "classes" ).'triggers'; + $filesArray = array(); + if (file_exists($dir)){ if ($handle = opendir($dir)) { - while (false !== ($file = readdir($handle))) { - if(($file!=".")&&($file!="..")){ - $this->registerFunctionsFileToLibrary ($dir.PATH_SEP. $file, "ProcessMaker External Functions"); - } + while (false !== ($file = readdir($handle))) { + if( $file != "." && $file != ".." && !is_dir($dir . PATH_SEP . $file)){ + $this->registerFunctionsFileToLibrary( $dir . PATH_SEP . $file, "ProcessMaker External Functions"); } - closedir($handle); + } + closedir($handle); } } }