SugarCRM is now SugarAI! Read the announcement  

Bizarre logic hook problem

I was working on cleaning up some very very old code (I think v6 or v7)

As I do that I wanted to be more consistent with naming conventions

The original logic hook was

$hook_array['process_record'][] = Array(1,'conditional_formatting','custom/modules/Cases/conditional_formatting.php','ConditionalFormatting','conditional_formatting');

The cleaned up one was using camel case for the function, and a better name for the file

$hook_array['process_record'][] = array( 1, 'conditionalFormatting', 'custom/modules/Cases/Cases_ConditionalFormatting_Logic.php', 'ConditionalFormatting', 'conditionalFormatting');

Of course the class and the function names were changed consistently in the new file, the old file was removed.

I did a QRR, cleared cache etc... the logic_hook refuses to fire with the new names. I put a fatal log entry at the start of the hook function, nothing in the log.

If all I do is change the name of the refactored file, name of the function and name of the class to the old ones then everything runs smoothly.

Why would that be? How can renaming something (consistently I might add) break it?
It's puzzling...

FrancescaS

Parents
  • Hi Francesca,

    Yeah, something doesn't add up. I would be equally puzzled as renaming things wouldn't cause such problems, assuming everything lines up in the definition file, etc.

    Is it possible that the permissions on the files were changed when your renamed them? Other than that, the only other thing I can think of is the casing on the names...that is, the names might match, but the casing doesn't.

Reply
  • Hi Francesca,

    Yeah, something doesn't add up. I would be equally puzzled as renaming things wouldn't cause such problems, assuming everything lines up in the definition file, etc.

    Is it possible that the permissions on the files were changed when your renamed them? Other than that, the only other thing I can think of is the casing on the names...that is, the names might match, but the casing doesn't.

Children