matthewpoer

SugarCRM Persons and Activities Save Too Early Hack Fix

May 15th, 2013
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.56 KB | None | 0 0
  1. // this fucking hack!
  2. $request = $_REQUEST;
  3. unset($_REQUEST);
  4. $new_contact->save();
  5. $_REQUEST = $request;
  6.  
  7. /* getting to a point that whenever I have a before_save logic hook related to Contacts or Leads and it involves setting up calls, legacy code takes its meaning from $_REQUEST vars, especially with email addresses but with overall saving functionality also. Suspending the $_REQUEST and letting $object->save() do the real work just fixes it. But damn this is silly
  8.  
  9. Same principle applies to using Contact logic hooks to update parent/related accounts.
  10. */
Add Comment
Please, Sign In to add comment