Skip to content
Snippets Groups Projects
Commit 2bd19657 authored by Jochen Roth's avatar Jochen Roth Committed by Christian Kuhn
Browse files

[BUGFIX] Add fallback for link details

A link to a folder created in RTE leads to undefined
array key warning in frontend.

This has been fixed by using null coalescing
operator instead of ternary operator.

Resolves: #95519
Releases: master
Change-Id: I2f5315db87281825fc53a63fdf6edabc5a8a7b01
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/71496


Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarNikita Hovratov <nikita.h@live.de>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: default avatarNikita Hovratov <nikita.h@live.de>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
parent ad2a858b
Branches
Tags
No related merge requests found
......@@ -31,7 +31,7 @@ class FileOrFolderLinkBuilder extends AbstractTypolinkBuilder
*/
public function build(array &$linkDetails, string $linkText, string $target, array $conf): LinkResultInterface
{
$fileOrFolderObject = $linkDetails['file'] ?: $linkDetails['folder'];
$fileOrFolderObject = $linkDetails['file'] ?? $linkDetails['folder'] ?? null;
// check if the file exists or if a / is contained (same check as in detectLinkType)
if (!($fileOrFolderObject instanceof FileInterface) && !($fileOrFolderObject instanceof Folder)) {
throw new UnableToLinkException(
......
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