Przeglądaj źródła

Remove the uniqid assignement when the request is set to the Admin instance

Thomas Rabaix 13 lat temu
rodzic
commit
d2c5285291
2 zmienionych plików z 11 dodań i 5 usunięć
  1. 4 4
      Admin/Admin.php
  2. 7 1
      Controller/CRUDController.php

+ 4 - 4
Admin/Admin.php

@@ -1111,6 +1111,10 @@ abstract class Admin implements AdminInterface, DomainObjectInterface
             return;
         }
 
+        if ($this->hasRequest()) {
+            $admin->setRequest($this->getRequest());
+        }
+
         $fieldDescription->setAssociationAdmin($admin);
     }
 
@@ -1886,10 +1890,6 @@ abstract class Admin implements AdminInterface, DomainObjectInterface
     {
         $this->request = $request;
 
-        if ($request->get('uniqid')) {
-            $this->setUniqid($request->get('uniqid'));
-        }
-
         foreach ($this->getChildren() as $children) {
             $children->setRequest($request);
         }

+ 7 - 1
Controller/CRUDController.php

@@ -99,7 +99,13 @@ class CRUDController extends Controller
             $rootAdmin = $rootAdmin->getParent();
         }
 
-        $rootAdmin->setRequest($this->container->get('request'));
+        $request = $this->container->get('request');
+
+        $rootAdmin->setRequest($request);
+
+        if ($request->get('uniqid')) {
+            $rootAdmin->setUniqid($request->get('uniqid'));
+        }
     }
 
     /**