Browse Source

Supporting toArray method when cursor is found during findUsers retrieval in aclAction.

Benjamin Scholler 11 years ago
parent
commit
9cf05e5215
1 changed files with 6 additions and 1 deletions
  1. 6 1
      Controller/CRUDController.php

+ 6 - 1
Controller/CRUDController.php

@@ -770,7 +770,12 @@ class CRUDController extends Controller
 
 
         $this->admin->setSubject($object);
         $this->admin->setSubject($object);
         $aclUsers = $this->getAclUsers();
         $aclUsers = $this->getAclUsers();
-        
+        if (is_object($aclUsers)) {
+             if (method_exists($aclUsers, 'toArray')) {
+                 $aclUsers = $aclUsers->toArray();
+             }
+        }
+
         $adminObjectAclManipulator = $this->get('sonata.admin.object.manipulator.acl.admin');
         $adminObjectAclManipulator = $this->get('sonata.admin.object.manipulator.acl.admin');
         $adminObjectAclData = new AdminObjectAclData(
         $adminObjectAclData = new AdminObjectAclData(
             $this->admin,
             $this->admin,