Custom Module Logic Hook Internal Error

Hi guys,

I have a problem creating a logic hook for the custom module.

Please find below the steps done:

  1. Created file custom/Extension/modules/smt_smt_orders/Ext/LogicHooks/logic_hooks.php:
  1. Created file custom/Extension/modules/smt_smt_orders/Ext/LogicHooks/OrderUpdateHandler.php:
  1. Run Quick Repair and Rebuild in Admin panel

  2. Verified file custom/modules/smt_smt_orders/Ext/LogicHooks/logichooks.ext.php has been generated:

Problem:

After updating smt_smt_orders record in SuiteCRM I get [500] Internal Error. I can’t see any errors neither in suitecrm.log nor in Apache error log files.

Appreciate any help, I spent too much time trying to figure out what’s wrong. Thanks.

Can you try with placing your files like

  1. custom/modules/smt_smt_orders/logic_hooks.php

  2. custom/modules/smt_smt_orders/OrderUpdateHandler.php
    make sure you provide the file path with respect to this in 1) and then Run Repair Rebuild to check if anything logged in the function.

you can put log in the body of your function sendOrderUpdateEventToQueue as

$GLOBALS['log']->fatal("This code ran");

This sounds correct - the hook definition file goes there, to make use of the Extension Framework

This doesn’t sound so good. If you put it there the Extension Framework will also pick it up (which you can verify by seeing that it got pulled into the same file as the hook definition during QR&R - not good). You need to put it somewhere else (any place, as long as the hook definition points to it correctly).

1 Like

Moved file to custom/Extension/modules/smt_smt_orders/Ext/Custom/OrderUpdateHandler.php and pointed logic_hooks.php to it appropriately.

Works like a charm! Thank you!

1 Like