Revert "[BUGFIX] Let FrontendGroupRestriction handle missing TSFE gr_list property" 19/49719/2
authorMorton Jonuschat <m.jonuschat@mojocode.de>
Thu, 1 Sep 2016 13:08:04 +0000 (15:08 +0200)
committerMorton Jonuschat <m.jonuschat@mojocode.de>
Thu, 1 Sep 2016 13:08:13 +0000 (15:08 +0200)
This reverts commit 32408c592533aed1b7b9bc5b160d8871291bdd42.

Change-Id: I9e707bcaf9804a6918fb12db16a21dde3c77ec7e
Reviewed-on: https://review.typo3.org/49719
Reviewed-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: Morton Jonuschat <m.jonuschat@mojocode.de>
typo3/sysext/core/Classes/Database/Query/Restriction/FrontendGroupRestriction.php
typo3/sysext/core/Tests/Unit/Database/Query/Restriction/FrontendGroupRestrictionTest.php

index 4487059..b8db8ed 100644 (file)
@@ -33,7 +33,7 @@ class FrontendGroupRestriction implements QueryRestrictionInterface
      */
     public function __construct(array $frontendGroupIds = null)
     {
-        $this->frontendGroupIds = $frontendGroupIds === null ? explode(',', $GLOBALS['TSFE']->gr_list ?? '') : $frontendGroupIds;
+        $this->frontendGroupIds = $frontendGroupIds === null ? explode(',', $GLOBALS['TSFE']->gr_list) : $frontendGroupIds;
     }
 
     /**
index 66d4572..05718e8 100644 (file)
@@ -16,7 +16,6 @@ namespace TYPO3\CMS\Core\Tests\Unit\Database\Query\Restriction;
  */
 
 use TYPO3\CMS\Core\Database\Query\Restriction\FrontendGroupRestriction;
-use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
 
 class FrontendGroupRestrictionTest extends AbstractRestrictionTestCase
 {
@@ -57,22 +56,4 @@ class FrontendGroupRestrictionTest extends AbstractRestrictionTestCase
         $expression = $subject->buildExpression(['aTable' => ''], $this->expressionBuilder);
         $this->assertSame('("aTable"."myGroupField" IS NULL) OR ("aTable"."myGroupField" = \'\') OR ("aTable"."myGroupField" = \'0\') OR (FIND_IN_SET(\'2\', "aTable"."myGroupField")) OR (FIND_IN_SET(\'3\', "aTable"."myGroupField"))', (string)$expression);
     }
-
-    /**
-     * @test
-     */
-    public function handlesNullTypoScriptFrontendControllerGroupList()
-    {
-        $GLOBALS['TSFE'] = $this->prophesize(TypoScriptFrontendController::class);
-        $GLOBALS['TSFE']->gr_list = null;
-
-        $GLOBALS['TCA']['aTable']['ctrl'] = [
-            'enablecolumns' => [
-                'fe_group' => 'myGroupField',
-            ],
-        ];
-        $subject = new FrontendGroupRestriction();
-        $expression = $subject->buildExpression(['aTable' => ''], $this->expressionBuilder);
-        $this->assertSame('("aTable"."myGroupField" IS NULL) OR ("aTable"."myGroupField" = \'\') OR ("aTable"."myGroupField" = \'0\') OR (FIND_IN_SET(\'\', "aTable"."myGroupField"))', (string)$expression);
-    }
 }