Мой Drupal 8 внезапно перестал работать, он выдает мне эту ошибку:
На сайте произошла непредвиденная ошибка. Пожалуйста, попробуйте позже.
Symfony \ Component \ DependencyInjection \ Exception \ ServiceNotFoundException: служба "pathauto.verbose_messenger" зависит от несуществующей службы "мессенджер". в Symfony \ Component \ DependencyInjection \ Compiler \ CheckExceptionOnInvalidReferenceBehaviorPass
Symfony \ Component \ DependencyInjection \ Compiler \ CheckExceptionOnInvalidReferenceBehaviorPass-> processReferences (Array) (строка: 42)
Symfony \ Component \ DependencyInjection \ Compiler \ CheckExceptionOnInvalidReferenceBehaviorPass-> processDefinition (Object) (строка: 36)
Symfony \ Component \ DependencyInjection \ Compiler \ CheckExceptionOnInvalidReferenceBehaviorPass-> process (Object) (строка: 120)
Symfony \ Component \ DependencyInjection \ Compiler \ Compiler-> compile (Object) (строка: 573)
Symfony \ Component \ DependencyInjection \ ContainerBuilder-> compile () (строка: 1314)
Drupal \ Core \ DrupalKernel-> compileContainer () (строка: 891)
Drupal \ Core \ DrupalKernel-> initializeContainer () (строка: 467)
Drupal \ Core \ DrupalKernel-> boot () (строка: 663)
Drupal \ Core \ DrupalKernel-> handle (Объект) (строка: 19) `
Кажется, Symfony не может найти сервис messenger
У кого-нибудь есть предложения, где проблема, а чего нет? Спасибо!
VerboseMessenger.php
<?php
namespace Drupal\pathauto;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Messenger\MessengerInterface as CoreMessengerInterface;
use Drupal\Core\Session\AccountInterface;
/**
* Provides a verbose messenger.
*/
class VerboseMessenger implements MessengerInterface {
/**
* The verbose flag.
*
* @var bool
*/
protected $isVerbose;
/**
* The config factory.
*
* @var \Drupal\Core\Config\ConfigFactoryInterface
*/
protected $configFactory;
/**
* The current user account.
*
* @var \Drupal\Core\Session\AccountInterface
*/
protected $account;
/**
* The messenger service.
*
* @var \Drupal\Core\Messenger\MessengerInterface
*/
protected $messenger;
/**
* Creates a verbose messenger.
*
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The config factory.
* @param \Drupal\Core\Session\AccountInterface $account
* The current user account.
* @param \Drupal\Core\Messenger\MessengerInterface $messenger
* The messenger service.
*/
public function __construct(ConfigFactoryInterface $config_factory, AccountInterface $account, CoreMessengerInterface $messenger) {
$this->configFactory = $config_factory;
$this->account = $account;
$this->messenger = $messenger;
}
/**
* {@inheritdoc}
*/
public function addMessage($message, $op = NULL) {
if (!isset($this->isVerbose)) {
$config = $this->configFactory->get('pathauto.settings');
$this->isVerbose = $config->get('verbose') && $this->account->hasPermission('notify of path changes');
}
if (!$this->isVerbose || (isset($op) && in_array($op, array('bulkupdate', 'return')))) {
return FALSE;
}
if ($message) {
$this->messenger->addMessage($message);
}
return TRUE;
}
}
services.yml
services:
pathauto.generator:
class: Drupal\pathauto\PathautoGenerator
arguments: ['@config.factory', '@module_handler', '@token', '@pathauto.alias_cleaner', '@pathauto.alias_storage_helper', '@pathauto.alias_uniquifier', '@pathauto.verbose_messenger', '@string_translation', '@token.entity_mapper', '@entity_type.manager']
pathauto.alias_cleaner:
class: Drupal\pathauto\AliasCleaner
arguments: ['@config.factory', '@pathauto.alias_storage_helper', '@language_manager', '@cache.discovery', '@transliteration', '@module_handler']
pathauto.alias_storage_helper:
class: Drupal\pathauto\AliasStorageHelper
arguments: ['@config.factory', '@path.alias_storage', '@database','@pathauto.verbose_messenger', '@string_translation']
tags:
- { name: backend_overridable }
pathauto.alias_uniquifier:
class: Drupal\pathauto\AliasUniquifier
arguments: ['@config.factory', '@pathauto.alias_storage_helper','@module_handler', '@router.route_provider', '@path.alias_manager']
pathauto.verbose_messenger:
class: Drupal\pathauto\VerboseMessenger
arguments: ['@config.factory', '@current_user', '@messenger']
plugin.manager.alias_type:
class: Drupal\pathauto\AliasTypeManager
parent: default_plugin_manager
pathauto.settings_cache_tag:
class: Drupal\pathauto\EventSubscriber\PathautoSettingsCacheTag
arguments: ['@entity_field.manager', '@plugin.manager.alias_type']
tags:
- { name: event_subscriber }