Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Many AJAX requests fail because $module_dir is passed as an MBModule object #33

Open
wants to merge 1 commit into from

3 participants

Matt Snider John Mertic Chris Coleman
Matt Snider

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.

For more details see: http://www.sugarcrm.com/forums/showthread.php?t=73603

Matt Snider msnider 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.
5e22b7a
John Mertic

Hi Matt!

Thanks for this fix. Is there an existing bug in the SugarCRM bug tracker for this so we can track this for QA purposes ( http://bugs.sugarcrm.com )?

Also, we need to have a unit test to cover this fix. We have documentation on our wiki for this; please feel free to ask if you need any help in putting this together.

Thanks!

John Mertic

John Mertic

Hey Matt,

Would love to pull this fix in, just need two things from you:

Thanks, and look forward to hearing back from you.

Chris Coleman

I second what John says. Good fix, Matt!

John Mertic

Hi JanSiero!

Wanted to check back if you could get a bug and contribution agreement done for this pull request. We cannot pull in the fix without one.

Thanks!

John Mertic
Sugar Community Manager

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 22, 2011
  1. Matt Snider

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

    msnider authored
    …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.
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 0 deletions.
  1. +4 −0 include/utils/LogicHook.php
4 include/utils/LogicHook.php
View
@@ -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'])){
Something went wrong with that request. Please try again.