Verified Commit 2ecbcd5f authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3456890 by TravisCarden, smustgrave: 'The "%plugin_id" was not found'...

Issue #3456890 by TravisCarden, smustgrave: 'The "%plugin_id" was not found' warning message is confusing

(cherry picked from commit 54f16eb6)
parent 756ee0ca
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -90,7 +90,7 @@ public function getFallbackPluginId($plugin_id, array $configuration = []) {
   * {@inheritdoc}
   */
  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);
  }

+2 −2
Original line number Diff line number Diff line
@@ -181,12 +181,12 @@ public function testMissingBlockContent(): void {
    $this->logMessages = [];
    $config_importer = $this->configImporter();
    $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
    // block.
    $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);
  }

+1 −1
Original line number Diff line number Diff line
@@ -114,7 +114,7 @@ public function testGroupedDefinitions(): void {
   * @covers ::handlePluginNotFound
   */
  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');
    $this->assertSame('broken', $plugin->getPluginId());
  }