Issue Feature New Stale

#110251Scheduler task form for Symfony Commands (schedulable commands) should show the defined icon by ModifySchedulerTaskWizardListener

Tee Ohh 07/21/26, 15:12 updated 07/21/26, 15:12

Description

I have several Symfony Commands (schedulable commands) which have an event listener for the new ModifyNewSchedulerTaskWizardItemsEvent to override the default task icon. For the task wizard this works great. A huge usability improvement. I can also rename the task category.

<?php

declare(strict_types=1);

namespace Vendor\MyPackage\EventListener;

use TYPO3\CMS\Core\Attribute\AsEventListener;
use TYPO3\CMS\Scheduler\Event\ModifyNewSchedulerTaskWizardItemsEvent;

final class ModifySchedulerTaskWizardListener
{
    #[AsEventListener('ext-my-extkey-modify-scheduler-task-wizard')]
    public function __invoke(ModifyNewSchedulerTaskWizardItemsEvent $event): void
    {
        // Modify existing wizard items
        $wizardItems = $event->getWizardItems();
        foreach ($wizardItems as $key => $item) {
            if (isset($item['header']) && $item['header'] === 'Myextkey') {
                $item['header'] = 'My ext key';
                $event->addWizardItem($key, $item);
            }
            if (isset($item['title']) && str_contains($item['title'], 'myextkey:my-command')) {
                $item['icon'] = 'mimetypes-x-tx_myextkey_task_my_command';
                $event->addWizardItem($key, $item);
            }
        }
    }
}

For the usability it would be great and consistent, if the Scheduler task form should also show the defined icon from the event listener and not the default one.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

Fix this issue

Start the commit message of your patch with this. Add what the patch does, and the versions it goes to in "Releases:". How to create a patch

Commit message
[FEATURE] Scheduler task form for Symfony Commands (schedulable commands) should show the defined icon by ModifySchedulerTaskWizardListener Resolves: #110251 Releases: main