Problem/Motivation

When editing module config page and saving changes I get error:

Error: Call to a member function addMessage() on null in Drupal\node_title_validation\Form\NodeTitleValidationAdminForm->submitForm() (line 228 of /var/www/html/web/modules/contrib/node_title_validation/src/Form/NodeTitleValidationAdminForm.php)

Proposed resolution

Replace node_title_validation/src/Form/NodeTitleValidationAdminForm.php line 228 from
$this->messenger->addMessage($this->t('Node Title Validation Configurations saved successfully!'));
to
$this->messenger()->addMessage($this->t('Node Title Validation Configurations saved successfully!'));

CommentFileSizeAuthor
#7 3414294-7.patch1.78 KBkeshavv
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

eskowe created an issue. See original summary.

Rohan_Singh made their first commit to this issue’s fork.

eskowe changed the visibility of the branch 3414294-submitting-form-throws to hidden.

keshavv’s picture

Status: Active » Needs review
StatusFileSize
new1.78 KB

Created patch, please review.

rohan_singh’s picture

Kindly review this MR.

Rohan_Singh changed the visibility of the branch 3414294-Submitting-form-throws-error to hidden.

eskowe’s picture

Status: Needs review » Reviewed & tested by the community

I tested and this works.

smustgrave’s picture

Status: Reviewed & tested by the community » Closed (duplicate)