Project

General

Profile

Actions

Bug #77764

closed

Image preview fails if storage is not public

Added by Philipp Gampe over 7 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
File Abstraction Layer (FAL)
Target version:
-
Start date:
2016-09-01
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
Is Regression:
Yes
Sprint Focus:

Description

This works in TYPO3 7.6, but somehow the file dump thinks it is in frontend mode and tries to get the list of frontend user groups, which do not exists.

Uncaught TYPO3 Exception
explode() expects parameter 2 to be string, null given 

TypeError thrown in file
/home/phil/t3-playground/t3-git/typo3/sysext/core/Classes/Database/Query/Restriction/FrontendGroupRestriction.php in line 36.

15 explode(",", NULL)

/home/phil/t3-playground/t3-git/typo3/sysext/core/Classes/Database/Query/Restriction/FrontendGroupRestriction.php:
00034:     public function __construct(array $frontendGroupIds = null)
00035:     {
00036:         $this->frontendGroupIds = $frontendGroupIds === null ? explode(',', $GLOBALS['TSFE']->gr_list) : $frontendGroupIds;
00037:     }
00038: 

14 TYPO3\CMS\Core\Database\Query\Restriction\FrontendGroupRestriction::__construct()

/home/phil/t3-playground/t3-git/typo3/sysext/core/Classes/Utility/GeneralUtility.php:
03889:         }
03890:         // Create new instance and call constructor with parameters
03891:         $instance = new $finalClassName(...$constructorArguments);
03892:         // Register new singleton instance
03893:         if ($instance instanceof SingletonInterface) {

13 TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance("TYPO3\CMS\Core\Database\Query\Restriction\FrontendGroupRestriction")

/home/phil/t3-playground/t3-git/typo3/sysext/core/Classes/Database/Query/Restriction/AbstractRestrictionContainer.php:
00091:     protected function createRestriction($restrictionClass)
00092:     {
00093:         return GeneralUtility::makeInstance($restrictionClass);
00094:     }
00095: }

12 TYPO3\CMS\Core\Database\Query\Restriction\AbstractRestrictionContainer::createRestriction("TYPO3\CMS\Core\Database\Query\Restriction\FrontendGroupRestriction")

/home/phil/t3-playground/t3-git/typo3/sysext/core/Classes/Database/Query/Restriction/FrontendRestrictionContainer.php:
00045:     {
00046:         foreach ($this->defaultRestrictionTypes as $restrictionType) {
00047:             $this->add($this->createRestriction($restrictionType));
00048:         }
00049:     }

11 TYPO3\CMS\Core\Database\Query\Restriction\FrontendRestrictionContainer::__construct()

/home/phil/t3-playground/t3-git/typo3/sysext/core/Classes/Utility/GeneralUtility.php:
03889:         }
03890:         // Create new instance and call constructor with parameters
03891:         $instance = new $finalClassName(...$constructorArguments);
03892:         // Register new singleton instance
03893:         if ($instance instanceof SingletonInterface) {

10 TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance("TYPO3\CMS\Core\Database\Query\Restriction\FrontendRestrictionContainer")

/home/phil/t3-playground/t3-git/typo3/sysext/core/Classes/Resource/AbstractRepository.php:
00203:         $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($this->table);
00204:         if ($this->getEnvironmentMode() === 'FE') {
00205:             $queryBuilder->setRestrictions(GeneralUtility::makeInstance(FrontendRestrictionContainer::class));
00206:         }
00207:         $row = $queryBuilder

9 TYPO3\CMS\Core\Resource\AbstractRepository::findByUid("371")

/home/phil/t3-playground/t3-git/typo3/sysext/core/Classes/Controller/FileDumpController.php:
00063:                 }
00064:             } else {
00065:                 $file = GeneralUtility::makeInstance(ProcessedFileRepository::class)->findByUid($parameters['p']);
00066:                 if ($file->isDeleted()) {
00067:                     $file = null;

8 TYPO3\CMS\Core\Controller\FileDumpController::dumpAction(TYPO3\CMS\Core\Http\ServerRequest, TYPO3\CMS\Core\Http\Response)
7 call_user_func_array(array, array)

/home/phil/t3-playground/t3-git/typo3/sysext/core/Classes/Http/Dispatcher.php:
00039:         $targetIdentifier = $request->getAttribute('target');
00040:         $target = $this->getCallableFromTarget($targetIdentifier);
00041:         return call_user_func_array($target, [$request, $response]);
00042:     }
00043: 

6 TYPO3\CMS\Core\Http\Dispatcher::dispatch(TYPO3\CMS\Core\Http\ServerRequest, TYPO3\CMS\Core\Http\Response)

/home/phil/t3-playground/t3-git/typo3/sysext/frontend/Classes/Http/EidRequestHandler.php:
00125:             $dispatcher = GeneralUtility::makeInstance(Dispatcher::class);
00126:             $request = $request->withAttribute('target', $configuration);
00127:             return $dispatcher->dispatch($request, $response);
00128:         }
00129: 

5 TYPO3\CMS\Frontend\Http\EidRequestHandler::dispatch(TYPO3\CMS\Core\Http\ServerRequest)

/home/phil/t3-playground/t3-git/typo3/sysext/frontend/Classes/Http/EidRequestHandler.php:
00073:         // Remove any output produced until now
00074:         $this->bootstrap->endOutputBufferingAndCleanPreviousOutput();
00075:         return $this->dispatch($request);
00076:     }
00077: 

4 TYPO3\CMS\Frontend\Http\EidRequestHandler::handleRequest(TYPO3\CMS\Core\Http\ServerRequest)

/home/phil/t3-playground/t3-git/typo3/sysext/core/Classes/Core/Bootstrap.php:
00309: 
00310:         // Execute the command which returns a Response object or NULL
00311:         $this->response = $requestHandler->handleRequest($request);
00312:         return $this;
00313:     }

3 TYPO3\CMS\Core\Core\Bootstrap::handleRequest(TYPO3\CMS\Core\Http\ServerRequest)

/home/phil/t3-playground/t3-git/typo3/sysext/frontend/Classes/Http/Application.php:
00078:     public function run(callable $execute = null)
00079:     {
00080:         $this->bootstrap->handleRequest(\TYPO3\CMS\Core\Http\ServerRequestFactory::fromGlobals());
00081: 
00082:         if ($execute !== null) {

2 TYPO3\CMS\Frontend\Http\Application::run()

/home/phil/t3-playground/t3-git/index.php:
00027: call_user_func(function () {
00028:     $classLoader = require rtrim(realpath(__DIR__ . '/typo3'), '\\/') . '/../vendor/autoload.php';
00029:     (new \TYPO3\CMS\Frontend\Http\Application($classLoader))->run();
00030: });

1 {closure}()

/home/phil/t3-playground/t3-git/index.php:
00028:     $classLoader = require rtrim(realpath(__DIR__ . '/typo3'), '\\/') . '/../vendor/autoload.php';
00029:     (new \TYPO3\CMS\Frontend\Http\Application($classLoader))->run();
00030: });

Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Task #77407: Migrate FAL AbstractRepositoryClosedBenni Mack2016-08-04

Actions
Related to TYPO3 Core - Bug #77213: Doctrine: Migrate EXT:core/Classes/Resource/StorageRepositoryClosedSebastian Bumann2016-07-22

Actions
Actions

Also available in: Atom PDF