DefaultLazyPluginCollection::initializePlugin() throws the wrong sort of exception

Created on 8 July 2025, 8 days ago

Problem/Motivation

DefaultLazyPluginCollection::initializePlugin() does this:

  protected function initializePlugin($instance_id) {
    $configuration = $this->configurations[$instance_id] ?? [];
    if (!isset($configuration[$this->pluginKey])) {
      throw new PluginNotFoundException($instance_id);
    }

PluginNotFoundException is not the right thing to throw here. The problem is not necessarily that there is no plugin with ID $instance_id, but could also be because $configuration doesn't contain a key $this->pluginKey.

That can happen if:
- the plugin configuration uses a key other than ID
- the configuration in the config entities doesn't store the plugin ID in the configuration.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Active

Version

11.0 πŸ”₯

Component

plugin system

Created by

πŸ‡¬πŸ‡§United Kingdom joachim

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024