Skip Navigation
Expand
Hooks not executing properly in Staging or Production areas of the Customer Portal
Answer ID 6779   |   Last Review Date 10/31/2018

In a system with multiple hooks, why is my first hook the only one executed?

Enviroment:

Customer Portal
Oracle B2C Service, all versions

Resolution:

In systems with multiple hooks, it is necessary to ensure that Message Base names are also not used as Variable Names. For statements such as the following:

$CUSTOM_MSG_ASK_ERROR_AANHEF_MISSING = RNCPHP\MessageBase::fetch(CUSTOM_MSG_ASK_ERROR_AANHEF_MISSING);

The php optimizer will replace the Variable Name with the optimized number for the Message Base name, providing unexpected behavior in Staging and Production Environments.

$(11876876)= RNCPHP\MessageBase::fetch( (11876876) );

In summary, the system will behave as intended in Development environments, where code is not optimized. The system will fail or behave unpredictably in Staging and Production environments where the code has been optimized.