Issue with Logic hook v7.14.2

Okay so I’m running into an odd issue. I have an install of 7.14.2 on a new server host (a2 hosting)… Trying to throw together a quick logic hook and … it’s not working…

I added the logic_hooks to the array through extension… rebuilt - it’s showing up as expected in the ext/logichooks folder…

If I JUST write to a log, the logic hook works fine. If I try to do ANYTHING related to the bean even $bean->name into a log… it hangs after clicking save on the module and appears to be trying to redirect back to index.php. Code below if it helps… but if I uncomment the part to set the variable for the name - it crashes. Just the log, works fine … I have done a rebuild, checked permissions, etc.

<?php

    if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
    class TestLHClass
     {
         function TestLHFunction($bean, $event, $arguments)
         {
            $GLOBALS['log']->debug('KorApp Inside Test LH');
            
            //$name = $bean->name;
            
            //$GLOBALS['log']->debug('KorApp Inside Test LH' + $name);
            
            
             
         }
     }

Try this:

$GLOBALS[‘log’]->fatal('With complex values such as arrays: ’ . print_r($row, true));

or this:

$GLOBALS[‘log’]->fatal(“Using string interpolation with double-quotes: $oneValue, $anotherValue”);

1 Like

Disregard ha… too much sql lately it seems…

For the record if anyone else has some random issue like this…
"+ " != “.”

when concatenating … syntax ha… thank you for the quick response though!

Remember: the php_errors.log was telling you the answer to your problem, since the first moment. It makes no sense to come to the forums asking questions without first checking your logs.

1 Like