Details
-
Improvement
-
Resolution: Obsolete
-
Medium
-
None
-
4.4.0
-
None
Description
I was in a situation where I was calling eZOperationHandler::execute with a missing parameter, in the $operationParameters array. This caused the method to fail silently, and do nothing.
This is happening because
$result = $this->executeClassMethod( $includeFile, $className, $method,
$tmpOperationParameterDefinitions, $operationParameters );
will return
array 'internal_error' => int 8 'internal_error_parameter_name' => string 'option_list' (length=11)
when there is a missing parameter, so it will skip the following if test, and fail silently.
if ( $result && array_key_exists( 'status', $result ) )
It would be nice if this was logged with a notice of some sort, so you could see it in the error logs.
Steps to reproduce
eZOperationHandler::execute( 'shop', 'addtobasket', array( 'basket_id' => (int) $basket->attribute( 'id' ), 'object_id' => (int) 2, // A product 'quantity' => (int) 1, 'option_list' => null ));
I've set the option_list to null for as an example, obviously this would be gotten form some other place.