Drupal previously used installer-specific extension list implementations to preserve pathnames added with setPathname() during installer container rebuilds.
That is no longer necessary. The base extension list behavior now preserves added pathnames across reset(), so the installer-specific trait and classes no
longer provide any unique behavior. Core also no longer replaces the extension.list.module and extension.list.theme services with installer-specific classes
during installation.
What changed
The following installer-specific APIs are deprecated in Drupal 11.5.0 and will be removed in Drupal 13.0.0:
- Drupal\Core\Installer\ExtensionListTrait
- Drupal\Core\Installer\InstallerModuleExtensionList
- Drupal\Core\Installer\InstallerThemeEngineExtensionList
- Drupal\Core\Installer\InstallerThemeExtensionList
Use these instead:
- Drupal\Core\Extension\ModuleExtensionList
- Drupal\Core\Extension\ThemeExtensionList
There is no replacement for Drupal\Core\Installer\ExtensionListTrait. The base extension list behavior now provides the same functionality.
Before
use Drupal\Core\Installer\ExtensionListTrait;
use Drupal\Core\Installer\InstallerModuleExtensionList;
use Drupal\Core\Installer\InstallerThemeExtensionList;
class MyInstallerModuleExtensionList extends InstallerModuleExtensionList {
}
class MyInstallerThemeExtensionList extends InstallerThemeExtensionList {
}
class MyCustomExtensionList extends ModuleExtensionList {
use ExtensionListTrait;
}
After
use Drupal\Core\Extension\ModuleExtensionList;
use Drupal\Core\Extension\ThemeExtensionList;
class MyModuleExtensionList extends ModuleExtensionList {
}
class MyThemeExtensionList extends ThemeExtensionList {
}
class MyCustomExtensionList extends ModuleExtensionList {
}
How to update your code
- If your code typehints InstallerModuleExtensionList, change it to ModuleExtensionList.
- If your code typehints InstallerThemeExtensionList, change it to ThemeExtensionList.
- If your custom extension list class uses ExtensionListTrait, remove the trait. The inherited behavior from the base extension list class is sufficient.
Notes
The deprecated installer classes remain as backward-compatibility wrappers for now, but core no longer uses them during installation.