FriendsOfTYPO3 / extension_builder

TYPO3 extension to kickstart and maintain TYPO3 extensions
https://docs.typo3.org/p/friendsoftypo3/extension-builder/11.0/en-us/
GNU General Public License v2.0
111 stars 80 forks source link

configurePlugin #507

Open hgalt opened 2 years ago

hgalt commented 2 years ago

Describe the bug The result seems not compatible with the proposal https://docs.typo3.org/m/typo3/book-extbasefluid/master/en-us/4-FirstExtension/7-configuring-the-plugin.html

<?php
defined('TYPO3') || die();

(static function() {
    \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
        'Album',
        'Showalbum',
        [
            \HGA\Album\Controller\AlbumController::class => 'list, show, new, create, edit, update'
        ],
        // non-cacheable actions
        [
            \HGA\Album\Controller\AlbumController::class => 'create, update'
        ]
    );

    // wizards
    \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig(
        'mod {
            wizards.newContentElement.wizardItems.plugins {
                elements {
                    showalbum {
                        iconIdentifier = album-plugin-showalbum
                        title = LLL:EXT:album/Resources/Private/Language/locallang_db.xlf:tx_album_showalbum.name
                        description = LLL:EXT:album/Resources/Private/Language/locallang_db.xlf:tx_album_showalbum.description
                        tt_content_defValues {
                            CType = list
                            list_type = album_showalbum
                        }
                    }
                }
                show = *
            }
       }'
    );
})();

used static function instead of

call_user_func(
   function ()

Also under Configuration→TCA→Overrides→tt_content.php→registerPlugin the part for the icon is missing.

TYPO3 Version V11.5.0 Extension Builder Version: V11 Master

simonschaufi commented 2 years ago

the static is a tiny optimization and as long as you don't use $this, there is no difference. Using static function here is better than without.

Please create a separate issue about the plugin icon. Thank you!