Skip to content
Snippets Groups Projects
Commit 267d91dc authored by Mark Fullmer's avatar Mark Fullmer
Browse files

Issue #3422683 by solideogloria, sarwan_verma, Chandreshgiri Gauswami: [Drupal...

Issue #3422683 by solideogloria, sarwan_verma, Chandreshgiri Gauswami: [Drupal 11] watchdog_exception() is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0
parent 2d9298ef
No related branches found
No related tags found
No related merge requests found
Pipeline #170048 canceled
......@@ -6,9 +6,11 @@ use Drupal\Component\Utility\Html;
use Drupal\Core\Entity\EntityRepositoryInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\Utility\Error;
use Drupal\filter\FilterProcessResult;
use Drupal\filter\Plugin\FilterBase;
use Drupal\linkit\SubstitutionManagerInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
......@@ -40,6 +42,13 @@ class LinkitFilter extends FilterBase implements ContainerFactoryPluginInterface
*/
protected $substitutionManager;
/**
* The logger.
*
* @var \Psr\Log\LoggerInterface
*/
protected $logger;
/**
* Constructs a LinkitFilter object.
*
......@@ -53,12 +62,15 @@ class LinkitFilter extends FilterBase implements ContainerFactoryPluginInterface
* The entity repository service.
* @param \Drupal\linkit\SubstitutionManagerInterface $substitution_manager
* The substitution manager.
* @param \Psr\Log\LoggerInterface $logger
* The logger.
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityRepositoryInterface $entity_repository, SubstitutionManagerInterface $substitution_manager) {
public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityRepositoryInterface $entity_repository, SubstitutionManagerInterface $substitution_manager, LoggerInterface $logger) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->entityRepository = $entity_repository;
$this->substitutionManager = $substitution_manager;
$this->logger = $logger;
}
/**
......@@ -70,7 +82,8 @@ class LinkitFilter extends FilterBase implements ContainerFactoryPluginInterface
$plugin_id,
$plugin_definition,
$container->get('entity.repository'),
$container->get('plugin.manager.linkit.substitution')
$container->get('plugin.manager.linkit.substitution'),
$container->get('logger.factory')->get('linkit')
);
}
......@@ -175,7 +188,7 @@ class LinkitFilter extends FilterBase implements ContainerFactoryPluginInterface
}
}
catch (\Exception $e) {
\Drupal\Component\Utility\DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '10.1.0', fn() => \Drupal\Core\Utility\Error::logException(\Drupal::logger('linkit_filter'), $e), fn() => watchdog_exception('linkit_filter', $e));
Error::logException($this->logger, $e);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment