Permalink
Browse files

Many AJAX requests fail because $module_dir is passed as an MBModule …

…object which cannot be converted to a string. The solution is to get the module name when applicable. Without this patch, many AJAX requests in the Module Builder break.
  • Loading branch information...
1 parent 68b9a68 commit 5e22b7a1025a923fcc999276b59138dff13e2b5a @msnider committed Jul 22, 2011
Showing with 4 additions and 0 deletions.
  1. +4 −0 include/utils/LogicHook.php
View
4 include/utils/LogicHook.php
@@ -91,6 +91,10 @@ function setBean(&$bean){
* @param SugarBean $bean
*/
function call_custom_logic($module_dir, $event, $arguments = null){
+ if ($module_dir instanceof MBModule) {
+ $module_dir = (string) $module_dir->getModuleName();
+ }
+
// declare the hook array variable, it will be defined in the included file.
$hook_array = null;
if(isset($GLOBALS['log'])){

0 comments on commit 5e22b7a

Please sign in to comment.