Skip to content
Snippets Groups Projects

3414294-submitting-form-throws: Fixed the messenger issue.

1 file
+ 12
2
Compare changes
  • Side-by-side
  • Inline
@@ -7,6 +7,7 @@ use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Entity\EntityTypeManager;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Messenger\MessengerInterface;
/**
* Class NodeTitleValidationAdminForm.
@@ -29,6 +30,13 @@ class NodeTitleValidationAdminForm extends FormBase {
*/
protected $configFactory;
/**
* The messenger service.
*
* @var \Drupal\Core\Messenger\MessengerInterface
*/
protected $messenger;
/**
* Constructs a new NodeTitleValidationController.
*
@@ -37,9 +45,10 @@ class NodeTitleValidationAdminForm extends FormBase {
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The configFactory.
*/
public function __construct(EntityTypeManager $entityTypeManager, ConfigFactoryInterface $config_factory) {
public function __construct(EntityTypeManager $entityTypeManager, ConfigFactoryInterface $config_factory, MessengerInterface $messenger) {
$this->entityTypeManager = $entityTypeManager;
$this->configFactory = $config_factory;
$this->messenger = $messenger;
}
/**
@@ -48,7 +57,8 @@ class NodeTitleValidationAdminForm extends FormBase {
public static function create(ContainerInterface $container) {
return new static(
$container->get('entity_type.manager'),
$container->get('config.factory')
$container->get('config.factory'),
$container->get('messenger')
);
}
Loading