Issue Bug Resolved

#111054Problem on https://docs.typo3.org/c/typo3/cms-dashboard/12.4/en-us/Developer/WidgetImplementation.html

Thomas Rawiel 10/14/26, 13:10 updated 10/16/26, 14:30

Description

https://docs.typo3.org/permalink/typo3-cms-dashboard:widget-php-class

The constructor of the example class, especially the used class for $cache is a little bit misleading/ confusing in my opinion:

class RssWidget implements WidgetInterface, RequestAwareWidgetInterface
{
    private ServerRequestInterface $request;

    public function __construct(
        private readonly WidgetConfigurationInterface $configuration,
        private readonly Cache $cache,
        private readonly BackendViewFactory $backendViewFactory,
        private readonly ButtonProviderInterface $buttonProvider = null,
        private readonly array $options = []
    ) {
    }

The original source in typo3/cms-dashboard has the following use statement:

use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface as Cache;

So the actual class used is TYPO3\CMS\Core\Cache\Frontend\FrontendInterface

I would suggest replacing the Cache class in the example’s constructor with the actual class TYPO3\CMS\Core\Cache\Frontend\FrontendInterface, like this has already been fixed in the typo3/cms-dashboard RssWidget class from version 13

(or add the use statements)

Reviews 3

History 36

  1. Thomas Rawiel commented <span data-processor="relativetime" data-value="2026-10-14T13:16:16+00:00" > 10/14/26, 13:16 </span>

    Also, in the documentation for TYPO3 12

     private readonly ButtonProviderInterface $buttonProvider = null,

    will produce a php error like

    PHP Fatal error:  Cannot use null as default value for parameter $buttonProvider of type TYPO3\CMS\Dashboard\Widgets\ButtonProviderInterface

    Should be

    private readonly ?ButtonProviderInterface $buttonProvider = null,

    like in the documentation for TYPO3 13 and up of this page

  2. Garvin Hicking changed status New Accepted TYPO3 Version 12 13 Complexity easy Sprint Focus On Location Sprint <span data-processor="relativetime" data-value="2026-10-15T08:05:19+00:00" > 10/15/26, 08:05 </span>

  3. Gerrit Code Review pushed patch set 1 for main to change 96736 status Accepted Under Review <span data-processor="relativetime" data-value="2026-10-15T18:14:56+00:00" > 10/15/26, 18:14 </span>

  4. Georg Ringer commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-10-16T14:30:19+00:00" > 10/16/26, 14:30 </span>

    Applied in changeset commit:9715742e043f874e1968fcc17da6a9ed73d77a09.