Skip to content
Snippets Groups Projects
Commit 1284cc7b authored by Jochen Roth's avatar Jochen Roth Committed by Stefan Bürk
Browse files

[BUGFIX] Return empty string in case the folder does not exist

Currently, when linking to a non-existing folder in and
the user clicks on save an error is thrown.

This has been fixed by returning early with a empty string
in case the folder object is null.

Resolves: #102014
Releases: main, 12.4
Change-Id: I548737fae5e6957fe59bf414b70737bea28700b5
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/81178


Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: default avatarOliver Klee <typo3-coding@oliverklee.de>
Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarGeorg Ringer <georg.ringer@gmail.com>
Reviewed-by: default avatarGeorg Ringer <georg.ringer@gmail.com>
parent 00421408
Branches
Tags
No related merge requests found
......@@ -46,6 +46,10 @@ class FolderLinkHandler implements LinkHandlingInterface
*/
public function asString(array $parameters): string
{
if (!isset($parameters['folder'])) {
return '';
}
// the magic with prepending slash if it is missing will not work on windows
return $this->baseUrn . '?storage=' . $parameters['folder']->getStorage()->getUid() .
'&identifier=' . urlencode('/' . ltrim($parameters['folder']->getIdentifier(), '/'));
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment