Problem/Motivation

At src/Plugin/Layout/LayoutOptions.php:463 we have:

$this->messenger->addError(t("Option definition, @option (@title), does not define a plugin id", ['@option' => $optionId, '@title' => isset($optionDefinition['title']) ? $optionDefinition['title'] : '']));

It should be replaced by

$this->messenger()->addError(t("Option definition, @option (@title), does not define a plugin id", ['@option' => $optionId, '@title' => isset($optionDefinition['title']) ? $optionDefinition['title'] : '']));

If not we get the following error:

Call to a member function addError() on null in Drupal\layout_options\Plugin\Layout\LayoutOptions->getOptionPlugin()

Steps to reproduce

  • Define a [provider].layout_options.yml with a not existing plugin.
  • Access to the LB page.
  • The error is thrown.
CommentFileSizeAuthor
#2 layout_options-3167630.patch1.16 KBjlbellido

Comments

jlbellido created an issue. See original summary.

jlbellido’s picture

Status: Active » Needs review
StatusFileSize
new1.16 KB

Hello,

I am providing a first patch to solve this issue.

In addtion, I've reviewed other possible cases but I didn't find any.

Cheers.

cgmonroe’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.