Skip to content
Snippets Groups Projects
Commit dd18d326 authored by Samit Khulve's avatar Samit Khulve Committed by Oleh Vehera
Browse files

Issue #3395610 by voleger, samit.310@gmail.com, Luukyb: watchdog_exception()...

Issue #3395610 by voleger, samit.310@gmail.com, Luukyb: watchdog_exception() is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0
parent 5d34cda0
Branches
Tags
1 merge request!43Resolve #3395610 "Watchdogexception is deprecated fix code"
Pipeline #169172 passed
Dekhteruk
Nascom
Oleh
Oleksandr
pifagor
Vehera
voleger
......@@ -54,8 +54,8 @@ There are no configuration provided.
- Oleh Vehera - [voleger](https://www.drupal.org/u/voleger)
- Oleksandr Dekhteruk - [pifagor](https://www.drupal.org/u/pifagor)
- DrupalSpoons Bot - [drupalspoons](https://www.drupal.org/u/drupalspoons)
**Supporting organization:**
- [Nascom](https://www.drupal.org/nascom)
- [Golems G.A.B.B.](https://www.drupal.org/golems-gabb)
......@@ -10,3 +10,4 @@ services:
- '@module_handler'
- '@messenger'
- '@queue'
- '@logger.factory'
......@@ -10,7 +10,7 @@ use Drupal\queue_ui\QueueUIManager;
use Drush\Commands\DrushCommands;
/**
* A Drush commandfile.
* A Drush commands file.
*
* Provide Drush command for queue_ui module.
*
......@@ -35,7 +35,7 @@ class QueueUiCommands extends DrushCommands {
public function __construct(
protected QueueWorkerManagerInterface $queueWorkerManager,
protected QueueUIManager $queueUiManager,
protected QueueUIBatchInterface $queueUiBatch
protected QueueUIBatchInterface $queueUiBatch,
) {
parent::__construct();
}
......
......@@ -24,7 +24,7 @@ class QueueProcessController implements ContainerInjectionInterface {
* Queue UI batch instance.
*/
public function __construct(
protected QueueUIBatchInterface $batch
protected QueueUIBatchInterface $batch,
) {}
/**
......
......@@ -39,7 +39,7 @@ class ConfirmClearForm extends ConfirmFormBase {
Messenger $messenger,
protected RendererInterface $renderer,
protected QueueWorkerManagerInterface $queueWorkerManager,
protected QueueFactory $queueFactory
protected QueueFactory $queueFactory,
) {
$this->messenger = $messenger;
}
......
......@@ -37,7 +37,7 @@ class ConfirmItemDeleteForm extends ConfirmFormBase {
*/
public function __construct(
MessengerInterface $messenger,
private QueueUIManager $queueUIManager
private QueueUIManager $queueUIManager,
) {
$this->messenger = $messenger;
}
......
......@@ -37,7 +37,7 @@ class ConfirmItemReleaseForm extends ConfirmFormBase {
*/
public function __construct(
Messenger $messenger,
private QueueUIManager $queueUIManager
private QueueUIManager $queueUIManager,
) {
$this->messenger = $messenger;
}
......
......@@ -23,7 +23,7 @@ class InspectForm extends FormBase {
* The QueueUIManager object.
*/
public function __construct(
private QueueUIManager $queueUIManager
private QueueUIManager $queueUIManager,
) {}
/**
......
......@@ -45,7 +45,7 @@ class ItemDetailForm extends FormBase {
private RendererInterface $renderer,
private ModuleHandlerInterface $moduleHandler,
LoggerChannelFactoryInterface $loggerFactory,
MessengerInterface $messenger
MessengerInterface $messenger,
) {
$this->logger = $loggerFactory->get('queue_ui');
$this->messenger = $messenger;
......
......@@ -62,7 +62,7 @@ class OverviewForm extends FormBase {
private QueueWorkerManagerInterface $queueWorkerManager,
private QueueUIManager $queueUIManager,
MessengerInterface $messenger,
protected QueueUIBatchInterface $queueUiBatch
protected QueueUIBatchInterface $queueUiBatch,
) {
$this->dbConnection = Database::getConnection('default');
$this->messenger = $messenger;
......@@ -141,7 +141,7 @@ class OverviewForm extends FormBase {
$queue_order_installed = $this->moduleHandler->moduleExists('queue_order');
if ($queue_order_installed) {
// Add the dragable options for the form.
// Add the draggable options for the form.
$form['queues']['#tabledrag'] = [
[
'action' => 'order',
......@@ -228,7 +228,7 @@ class OverviewForm extends FormBase {
'#type' => 'table',
];
$form['botton'] = [
$form['bottom'] = [
'actions' => [
'#type' => 'container',
'#attributes' => [
......
......@@ -67,7 +67,7 @@ class DatabaseQueue extends QueueUIBase implements ContainerFactoryPluginInterfa
array $configuration,
$plugin_id,
$plugin_definition,
protected Connection $database
protected Connection $database,
) {}
/**
......
......@@ -5,6 +5,7 @@ namespace Drupal\queue_ui;
use Drupal\Core\Batch\BatchBuilder;
use Drupal\Core\DependencyInjection\DependencySerializationTrait;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Logger\LoggerChannelFactoryInterface;
use Drupal\Core\Messenger\MessengerInterface;
use Drupal\Core\Queue\DelayableQueueInterface;
use Drupal\Core\Queue\DelayedRequeueException;
......@@ -13,6 +14,7 @@ use Drupal\Core\Queue\RequeueException;
use Drupal\Core\Queue\SuspendQueueException;
use Drupal\Core\Render\Markup;
use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\Core\Utility\Error;
/**
* Batch controller to process a queue.
......@@ -37,12 +39,15 @@ class QueueUIBatch implements QueueUIBatchInterface {
* Messenger.
* @param mixed|\Drupal\Core\Queue\QueueFactory $queueFactory
* Queue factory.
* @param \Drupal\Core\Logger\LoggerChannelFactoryInterface $logger
* The logger channel factory.
*/
public function __construct(
protected QueueWorkerManagerInterface $queueManager,
protected ModuleHandlerInterface $moduleHandler,
protected MessengerInterface $messenger,
protected mixed $queueFactory
protected mixed $queueFactory,
protected LoggerChannelFactoryInterface $logger,
) {}
/**
......@@ -127,7 +132,7 @@ class QueueUIBatch implements QueueUIBatchInterface {
$queue->releaseItem($item);
}
watchdog_exception('queue_ui', $e);
Error::logException($this->logger->get('queue_ui'), $e);
$context['results']['errors'][] = $e->getMessage();
// Marking the batch job as finished will stop further processing.
......@@ -136,7 +141,7 @@ class QueueUIBatch implements QueueUIBatchInterface {
catch (\Exception $e) {
// In case of any other kind of exception, log it and leave the item
// in the queue to be processed again later.
watchdog_exception('queue_ui', $e);
Error::logException($this->logger->get('queue_ui'), $e);
$context['results']['errors'][] = $e->getMessage();
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment