FluidTYPO3 / flux

TYPO3 extension Flux: Dynamic Fluid FlexForms
https://fluidtypo3.org
146 stars 212 forks source link

BUG: toggle button missing for grid based content element on TYPO3v11 #2137

Closed sdelcroix closed 1 year ago

sdelcroix commented 1 year ago

I have checked that the bug exists in the dev-development branch Yes.

I have checked that there are no already open issues or recently closed issues about this bug Yes.

Describe the bug In TYPO3v11, the toggle button of grid based content element is not displayed in "Page" module.

To Reproduce Steps to reproduce the behavior on TYPO3v11 :

  1. Go to 'Page' module
  2. Add a flux based content with grid
  3. See there's no toggle button on content "toolbar"

Expected behavior The toggle button should be displayed on content "toolbar"

Screenshots None

Additional context This is related to #2086

In this commit ( 1b9eaaa ), the "recStatInfoHooks" hook registration has been strictly restricted to TYPO3v10 and below in ext_localconf.php: https://github.com/FluidTYPO3/flux/commit/1b9eaaaabd52e9392f68c7b8afec15a91f46f99a#diff-5e15ae082e9095bfca62c8b83a7a2cdbcf8e5ac4c750ab8c832aa12cce7d7a74R102 But this hook has been removed from the core since TYPO3v12 ( https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/12.0/Breaking-98441-HookRecStatInfoHooksRemoved.html ).

Maybe a typo ? If I raise the restricted version to TYPO3v11 and below, as following, the toggle button is displayed and fully functional :

if (version_compare(\TYPO3\CMS\Core\Utility\VersionNumberUtility::getCurrentTypo3Version(), '12', '<'))  
{
        $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['recStatInfoHooks']['flux'] =
            \FluidTYPO3\Flux\Integration\HookSubscribers\ContentIcon::class . '->addSubIcon';
NamelessCoder commented 1 year ago

This functionality had to be removed.

The hook in question is deprecated on 11.5 and triggers several deprecation notices for every page module request - the PSR event that was implemented as substitute only triggers in list view and therefore cannot add the icon. Rather than allow the dispatching of thousands of deprecation notices, and since the feature would inevitably have to be removed later anyway and would not be availble on v12, I opted to just remove it early.

If you want it back and don't mind the thousands of deprecation log messages then you can register the hook in question in the ext_localconf.php file of your provider extension. But beware, there is no alternative if/when you upgrade to TYPO3v12.

sdelcroix commented 1 year ago

Thanks for this clear explanation @NamelessCoder ;) I admit that I did a really quick test and didn't look at any deprecation notices. I understood in #2086 that it was fixed for page module in v11 too :) I don't really need this feature, I just thought it was a "typo" that would have been easy to fix.

NamelessCoder commented 1 year ago

I think I just wrote it wrong in the issue comment - this is most definitely not fixed on v11 like the comment says :)

In any case, if someone wonders why that feature is gone and finds this issue, hopefully the above comment explains why and how to temporarily get it back if deprecation log spam isn't a problem.