after_relationship_add breaks automatic submodule refresh

I have placed an after_relationship_add logic_hook to the ProjectTask module.
The logic_hook fires just fine and does what it’s supposed to (change a few fields in the database via $db-query() )

However the respective submodule no longer reloads to update and show the new record. After manual refresh of the page the newly linked related record shows in the submodule.
I’ve tried both “after_” and “before_” relationship_add. Both break the standard submodule reload function.

Is there something I can do to force a reload of the submodule? Or anything else I need to know?

(I’m using an older version of SuiteCRM (7.4.1) in case anyone thinks this is related to the version…)

Try, Once the relationship is created then redirect to same page. So it gets refreshed

I’ve been working through adding a after_relationship_add logic hook and I saw this behavior when I had a php error in my logic hook code that was causing the php to halt midstep. Once I cleared up the php coding issues the page would refresh on adding a related record. Try adding some debug statements like

$GLOBALS[‘log’]->fatal(‘Some debug text’);

to your logic hook’s class function so you can see how far your code is progressing by watching your suitecrm.log after you trigger the code.