AnsweredAssumed Answered

500 Server Error on Logic Hook

Question asked by Shad on Jul 10, 2015
Latest reply on Jul 10, 2015 by Shad
I am getting a 500 error on saving an Account Record in 7.6 Enterprise. 

Not sure if it is a server configuration or what (Ubuntu 12.04). Have mod_rewrite enabled and AllowOverride = All in the config. Also tried multiple times clearing cache and updating permissions. 

In /custom/Extension/modules/Accounts/Ext/LogicHooks/logic_hooks.ext.php I have:

$hook_array['before_save'][] = Array(2, 'Sales Transfer', 'custom/modules/Accounts/sales_transfer.php','SalesTransfer', 'salesTransfer');$hook_array['before_save'][] = Array(3, 'Update Team Name for reporting', 'custom/modules/Accounts/team_name.php','TeamName', 'teamName');

$hook_array['after_retrieve'] = Array();
$hook_array['after_retrieve'][] = Array(1, 'First Contact Date', 'custom/modules/Accounts/first_contact_date.php','FirstContact', 'firstContact');


And in /custom/modules/Accounts/first_contact_date.php :

class FirstContact
{
    function firstContact ($bean, $event, $args)
    {

        $GLOBALS['log']->fatal('FirstContact::firstContact()');
    }
}



Sugar outputs the following: 
HTTP: 500 Internal Server Error

Your request failed to complete. A fatal error occurred. Check logs for more details.



In the Chrome console I see this error:

  GET http://<sugarurl>/rest/v10/Accounts/4f4706a4-ad5f-af...utilities_c%2Cincome_total_c%2Cloan_total_c%2Clos_id_c%2C... 500 (Internal Server Error)  sidecar.min.js?v=jkbQEHWppPs_2hYRgwmR7w:29    I 


sugarcrm.log
Jul 10 12:50:16 2015 [9897][1504978a-3065-5947-bc90-51245a0f56aa][FATAL] FirstContact::firstContact()
Fri Jul 10 12:50:16 2015 [9897][1504978a-3065-5947-bc90-51245a0f56aa][FATAL] FirstContact::firstContact()
Fri Jul 10 14:50:17 2015 [9830][-none-][FATAL] Configuration variable date.timezone is not set, guessed timezone America/Chicago. Please set date.timezone="America/Chicago" in php.ini!
Fri Jul 10 12:50:17 2015 [9897][1504978a-3065-5947-bc90-51245a0f56aa][ERROR] A PHP error occurred:
<br />
<b>Warning</b>:  Missing argument 1 for FirstContact::firstContact(), called in /var/www/html/ProficioRedo/Proficio/include/utils/LogicHook.php on line 223 and defined in <b>/var/www/html/ProficioRedo/Proficio/custom/modules/Accounts/first_contact_date.php</b> on line <b>20</b><br />
<br />
<b>Warning</b>:  Missing argument 2 for FirstContact::firstContact(), called in /var/www/html/ProficioRedo/Proficio/include/utils/LogicHook.php on line 223 and defined in <b>/var/www/html/ProficioRedo/Proficio/custom/modules/Accounts/first_contact_date.php</b> on line <b>20</b><br />
<br />
<b>Warning</b>:  Missing argument 3 for FirstContact::firstContact(), called in /var/www/html/ProficioRedo/Proficio/include/utils/LogicHook.php on line 223 and defined in <b>/var/www/html/ProficioRedo/Proficio/custom/modules/Accounts/first_contact_date.php</b> on line <b>20</b><br />

I'm totally lost.

Outcomes