Skip to content

Commit

Permalink
[BUGFIX] Omit click menu on icons in browse mode
Browse files Browse the repository at this point in the history
The element browsers, such as file browser,
folder browser or the create folder browser
are rendering the FileList in the `browse`
mode. In this case the context menu component
is not loaded. This is correct, since using
the context menu inside the modal would lead
to various side effects.

Because the JS component is not loaded for
mentioned reasons, wrapping the icons with
the click menu needs to be omitted. This
otherwise leads to further side effect,
e.g. loading a second folder tree in the
create folder browser.

Therefore, this change now omits wrapping
the icon with then click menu when the
Filelist is used in the `browse` mode.

Resolves: #103001
Releases: main, 12.4
Change-Id: Ifd4daf5487b5dd9c74553d48cd0c2270b2c4f58b
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/82755
Tested-by: Oliver Bartsch <bo@cedev.de>
Reviewed-by: Oliver Bartsch <bo@cedev.de>
Reviewed-by: Andreas Kienast <a.fernandez@scripting-base.de>
Tested-by: Simon Schaufelberger <simonschaufi+typo3@gmail.com>
Tested-by: Andreas Kienast <a.fernandez@scripting-base.de>
Reviewed-by: Garvin Hicking <gh@faktor-e.de>
Reviewed-by: Simon Schaufelberger <simonschaufi+typo3@gmail.com>
Tested-by: Garvin Hicking <gh@faktor-e.de>
Tested-by: core-ci <typo3@b13.com>
  • Loading branch information
o-ba committed Feb 5, 2024
1 parent 9e4c146 commit 335c2b9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion typo3/sysext/filelist/Classes/FileList.php
Expand Up @@ -609,7 +609,9 @@ protected function getTranslationsForMetaData($metaDataRecord)
*/
protected function renderIcon(ResourceView $resourceView): string
{
return BackendUtility::wrapClickMenuOnIcon($resourceView->getIconSmall()->render(), 'sys_file', $resourceView->getIdentifier());
return $this->mode === Mode::BROWSE
? $resourceView->getIconSmall()->render()
: BackendUtility::wrapClickMenuOnIcon($resourceView->getIconSmall()->render(), 'sys_file', $resourceView->getIdentifier());
}

/**
Expand Down

0 comments on commit 335c2b9

Please sign in to comment.