Details
-
Bug
-
Resolution: Fixed
-
High
-
5.3.7, 5.4.4.3, 2015.09.1
-
None
Description
Using public API, when updating a policy without limitations, following exception is thrown:
Catchable Fatal Error: Argument 2 passed to eZ\Publish\Core\Persistence\Legacy\User\Role\Gateway\ExceptionConversion::addPolicyLimitations() must be of the type array, string given, called in /Users/lolautruche/workspace/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/User/Handler.php on line 443
This is because when there is no limitations, limitations property of SPI policy is *, as documented in \eZ\Publish\SPI\Persistence\User\Policy:
/** * Array of policy limitations, which is just a random hash map. * * The limitation array may look like: * <code> * array( * 'Subtree' => array( * '/1/2/', * '/1/4/', * ), * 'Foo' => array( 'Bar' ), * … * ) * </code> * * Where the keys are the limitation identifiers, and the respective values * are an array of limitation values * * @var array|string If string, then only the value '*' is allowed, meaning all limitations. * Can not be a empty array as '*' should be used in this case. */ public $limitations;
Legacy storage engine doesn't take this case into account.
*Note*: This occurs using RoleService::updatePolicy() and RoleService::updatePolicyByRoleDraft().