Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory exhausted error if settings.storage is empty #157

Open
beckerr-rzht opened this issue Feb 19, 2021 · 0 comments
Open

Memory exhausted error if settings.storage is empty #157

beckerr-rzht opened this issue Feb 19, 2021 · 0 comments

Comments

@beckerr-rzht
Copy link
Contributor

I'm using Typo3 10.4.12 with fal_securedownload 3.0.0.

I have created a page that contains nothing more than a plugin of type "falsecuredownload_filetree".
There I then "forgot" to select a storage, so I left "settings.storage" empty.

Screenshot

image

Problem

When I call the page I see the following error:

Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 110592 bytes) .../ForViewHelper.php on line 133

Solution

--- a/Classes/Controller/FileTreeController.php
+++ b/Classes/Controller/FileTreeController.php
@@ -52,6 +52,8 @@ public function __construct(ResourceFactory $resourceFactory = null)
      */
     public function treeAction()
     {
+        if ($this->settings['storage'] === '')
+            return;
         try {
             $folder = $this->resourceFactory->getFolderObjectFromCombinedIdentifier($this->settings['storage'] . ':' . $this->settings['folder']);
         } catch (FolderDoesNotExistException $exception) {

I will do a pull request for this...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant