Quellcode durchsuchen

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.
Fabien Potencier vor 14 Jahren
Ursprung
Commit
061ce6d833
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  1. 1 1
      src/Symfony/Component/Security/Acl/Domain/DoctrineAclCache.php

+ 1 - 1
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) {