[BUGFIX] Fix generation of create action URLs in backend user module 72/57172/3
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Sun, 10 Jun 2018 19:09:20 +0000 (21:09 +0200)
committerRiccardo De Contardi <erredeco@gmail.com>
Sun, 10 Jun 2018 20:18:57 +0000 (22:18 +0200)
The URLs to the create actions for backend users and backend groups were
built in a strange way which required some quirks to be fully functional.

This patch removes the unnecessary `explodeUrl2Array()` call, which also
renders the `rawurlencode()` obsolete.

Resolves: #85211
Releases: master
Change-Id: I3b8f5864fc398b9a4f8f2c0de5d72a38cb8a471b
Reviewed-on: https://review.typo3.org/57172
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Riccardo De Contardi <erredeco@gmail.com>
Tested-by: Riccardo De Contardi <erredeco@gmail.com>
typo3/sysext/beuser/Classes/Controller/BackendUserActionController.php

index 8fbec2c..a38370d 100644 (file)
@@ -133,7 +133,14 @@ class BackendUserActionController extends ActionController
         if ($this->request->getControllerName() === 'BackendUser') {
             if ($this->request->getControllerActionName() === 'index') {
                 $returnUrl = (string)$uriBuilder->buildUriFromRoute('system_BeuserTxBeuser');
-                $parameters = GeneralUtility::explodeUrl2Array('edit[be_users][0]=new&returnUrl=' . $returnUrl);
+                $parameters = [
+                    'edit' => [
+                        'be_users' => [
+                            0 => 'new'
+                        ]
+                    ],
+                    'returnUrl' => $returnUrl,
+                ];
                 $addUserLink = (string)$uriBuilder->buildUriFromRoute('record_edit', $parameters);
                 $title = $this->getLanguageService()->sL('LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:newRecordGeneral');
                 $icon = $this->view->getModuleTemplate()->getIconFactory()->getIcon('actions-add', Icon::SIZE_SMALL);
@@ -159,13 +166,20 @@ class BackendUserActionController extends ActionController
         }
         if ($this->request->getControllerName() === 'BackendUserGroup') {
             $shortcutName = $this->getLanguageService()->sL('LLL:EXT:beuser/Resources/Private/Language/locallang.xlf:backendUserGroupsMenu');
-            $returnUrl = rawurlencode((string)$uriBuilder->buildUriFromRoute('system_BeuserTxBeuser', [
+            $returnUrl = (string)$uriBuilder->buildUriFromRoute('system_BeuserTxBeuser', [
                 'tx_beuser_system_beusertxbeuser' => [
                     'action' => 'index',
                     'controller' => 'BackendUserGroup'
                 ]
-            ]));
-            $parameters = GeneralUtility::explodeUrl2Array('edit[be_groups][0]=new&returnUrl=' . $returnUrl);
+            ]);
+            $parameters = [
+                'edit' => [
+                    'be_groups' => [
+                        0 => 'new'
+                    ]
+                ],
+                'returnUrl' => $returnUrl,
+            ];
             $addUserLink = (string)$uriBuilder->buildUriFromRoute('record_edit', $parameters);
             $title = $this->getLanguageService()->sL('LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:newRecordGeneral');
             $icon = $this->view->getModuleTemplate()->getIconFactory()->getIcon('actions-add', Icon::SIZE_SMALL);