---
title: "Breaking: #96333 - Auto configuration of ContextMenu item providers"
manual: "TYPO3 Core Changelog"
version: "main"
permalink: "https://docs.typo3.org/permalink/changelog:breaking-96333"
source: "Changelog/12.0/Breaking-96333-AutoConfigurationOfContextMenuItemProviders.rst"
typo3-version: "12.0"
typo3-major: 12
type: "breaking"
issue: 96333
forge: "https://forge.typo3.org/issues/96333"
tags: ["Backend", "PHP-API", "FullyScanned", "ext:backend"]
rendered: "2026-09-24T21:45:06+00:00"
---

# Breaking: #96333 - Auto configuration of ContextMenu item providers {#breaking-96333}

See [forge#96333](https://forge.typo3.org/issues/96333)

## Description {#description}

ContextMenu item providers, implementing `\TYPO3\CMS\Backend\ContextMenu\ItemProviders\ProviderInterface`
are now automatically registered by adding the `backend.contextmenu.itemprovider`
tag, if `autoconfigure` is enabled in `Services.yaml`. The new
`\TYPO3\CMS\Backend\ContextMenu\ItemProviders\ItemProvidersRegistry` then
automatically receives those services and registers them.

All Core item providers extend the `AbstractProvider` class, which is
usually also used by extensions. Due to the auto configuration, the context
information (table, record identifier and context) is no longer passed to the
`__construct()`, but instead to the new `setContext()` method.

The `setContext()` method is therefore required for all item providers.

## Impact {#impact}

The registration via `$GLOBALS['TYPO3_CONF_VARS']['BE']['ContextMenu']['ItemProviders']`
isn't evaluated anymore.

The item providers are retrieved from the container and are no longer
instantiated while passing context information as constructor arguments.
The context information is now passed to `setContext()`.

## Affected Installations {#affected-installations}

All extensions, registering custom ContextMenu item providers.

All extensions, extending `AbstractProvider` and overwriting the
`__construct()` method.

All extensions, not extending `AbstractProvider`, but implementing
`\TYPO3\CMS\Backend\ContextMenu\ItemProviders\ProviderInterface` directly.

## Migration {#migration}

Remove `$GLOBALS['TYPO3_CONF_VARS']['BE']['ContextMenu']['ItemProviders']`
from your `ext_localconf.php` file. If `autoconfigure` is
not enabled in your `Configuration/Services.(yaml|php)` file,
manually configure your item providers with the
`backend.contextmenu.itemprovider` tag.

If your item providers extend `AbstractProvider` and overwrite the
`__construct()` method, adjust the signature like shown below:

```php
// Before

class MyItemProvider extends AbstractProvider {

    public function __construct(string $table, string $identifier, string $context = '')
    {
        parent::__construct($table, $identifier, $context);

        // My custom code
    }
}

// After

class MyItemProvider extends AbstractProvider {

    public function __construct()
    {
        parent::__construct();

        // My custom code
    }
}
```

In case you rely on the arguments, previously passed to `__construct()`,
you can override the new `setContext()` method, which is executed
prior to any other action like `canHandle()`.

```php
// Before

class MyItemProvider extends AbstractProvider {

    public function __construct(string $table, string $identifier, string $context = '')
    {
        parent::__construct($table, $identifier, $context);

        if ($table === 'my_table') {
            // Do something
        }
}

// After

class MyItemProvider extends AbstractProvider {

    public function setContext(string $table, string $identifier, string $context = ''): void
    {
        parent::setContext($table, $identifier, $context);

        if ($table === 'my_table') {
            // Do something
        }
    }
}
```

In case your item provider does not extend `AbstractProvider`, but instead
implements the `\TYPO3\CMS\Backend\ContextMenu\ItemProviders\ProviderInterface`
directly, add the new `setContext()` to the item provider.
