Browse Source

merged branch geoffreytran/doctrine-acl-cache (PR #1708)

Commits
-------

b9bdab8 DoctrineAclCache unserialize sets the acl to the wrong field

Discussion
----------

DoctrineAclCache unserialize sets the acl to the wrong field

Upon unserialize of the acl, the acl is currently set to the id field which should be a string. Currently it passes the acl object into the id field which causes the following error upon unserialize.

Warning: Illegal offset type in isset or empty in Symfony/Component/Security/Acl/Dbal/AclProvider.php line 404
This is because at line 404, $ace->getId() returns an Acl object not an id and the acl field in $ace is null.
     if (isset($this->loadedAces[$ace->getId()])) {

---------------------------------------------------------------------------

by fabpot at 2011/07/16 09:31:42 -0700

@schmittjoh?

---------------------------------------------------------------------------

by schmittjoh at 2011/07/16 23:19:06 -0700

Yes, this fix is good.
pull/1717/merge
Fabien Potencier 14 years ago
parent
commit
061ce6d833
  1. 2
      src/Symfony/Component/Security/Acl/Domain/DoctrineAclCache.php

2
src/Symfony/Component/Security/Acl/Domain/DoctrineAclCache.php

@ -165,7 +165,7 @@ class DoctrineAclCache implements AclCacheInterface
$reflectionProperty->setValue($acl, $this->permissionGrantingStrategy);
$reflectionProperty->setAccessible(false);
$aceAclProperty = new \ReflectionProperty('Symfony\Component\Security\Acl\Domain\Entry', 'id');
$aceAclProperty = new \ReflectionProperty('Symfony\Component\Security\Acl\Domain\Entry', 'acl');
$aceAclProperty->setAccessible(true);
foreach ($acl->getObjectAces() as $ace) {

Loading…
Cancel
Save