Issue #3456890 by TravisCarden, smustgrave: 'The "%plugin_id" was not found' warning message is confusing
parent
57325ce447
commit
54f16eb60c
|
@ -90,7 +90,7 @@ class BlockManager extends DefaultPluginManager implements BlockManagerInterface
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
protected function handlePluginNotFound($plugin_id, array $configuration) {
|
protected function handlePluginNotFound($plugin_id, array $configuration) {
|
||||||
$this->logger->warning('The "%plugin_id" was not found', ['%plugin_id' => $plugin_id]);
|
$this->logger->warning('The "%plugin_id" block plugin was not found', ['%plugin_id' => $plugin_id]);
|
||||||
return parent::handlePluginNotFound($plugin_id, $configuration);
|
return parent::handlePluginNotFound($plugin_id, $configuration);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -181,12 +181,12 @@ class ConfigImporterMissingContentTest extends KernelTestBase implements LoggerI
|
||||||
$this->logMessages = [];
|
$this->logMessages = [];
|
||||||
$config_importer = $this->configImporter();
|
$config_importer = $this->configImporter();
|
||||||
$config_importer->import();
|
$config_importer->import();
|
||||||
$this->assertNotContains('The "block_content:6376f337-fcbf-4b28-b30e-ed5b6932e692" was not found', $this->logMessages);
|
$this->assertNotContains('The "block_content:6376f337-fcbf-4b28-b30e-ed5b6932e692" block plugin was not found', $this->logMessages);
|
||||||
|
|
||||||
// Ensure the expected message is generated when creating an instance of the
|
// Ensure the expected message is generated when creating an instance of the
|
||||||
// block.
|
// block.
|
||||||
$instance = $this->container->get('plugin.manager.block')->createInstance($plugin_id);
|
$instance = $this->container->get('plugin.manager.block')->createInstance($plugin_id);
|
||||||
$this->assertContains('The "block_content:6376f337-fcbf-4b28-b30e-ed5b6932e692" was not found', $this->logMessages);
|
$this->assertContains('The "block_content:6376f337-fcbf-4b28-b30e-ed5b6932e692" block plugin was not found', $this->logMessages);
|
||||||
$this->assertInstanceOf(Broken::class, $instance);
|
$this->assertInstanceOf(Broken::class, $instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -114,7 +114,7 @@ class BlockManagerTest extends UnitTestCase {
|
||||||
* @covers ::handlePluginNotFound
|
* @covers ::handlePluginNotFound
|
||||||
*/
|
*/
|
||||||
public function testHandlePluginNotFound(): void {
|
public function testHandlePluginNotFound(): void {
|
||||||
$this->logger->warning('The "%plugin_id" was not found', ['%plugin_id' => 'invalid'])->shouldBeCalled();
|
$this->logger->warning('The "%plugin_id" block plugin was not found', ['%plugin_id' => 'invalid'])->shouldBeCalled();
|
||||||
$plugin = $this->blockManager->createInstance('invalid');
|
$plugin = $this->blockManager->createInstance('invalid');
|
||||||
$this->assertSame('broken', $plugin->getPluginId());
|
$this->assertSame('broken', $plugin->getPluginId());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue