From 1db60acc7e7f99d6991a25b0957c6c09b6244550 Mon Sep 17 00:00:00 2001 From: lazysoundsystem Date: Thu, 30 Jan 2025 10:51:16 -0300 Subject: [PATCH] updates: new amazon_ses patch Refs: updates --- .../amazon_ses-3417090-cron-queue-14.patch | 18 --------------- PATCHES/amazon_ses-cron-queue-3417090-8.patch | 23 +++++++++++++++++++ composer.patches.json | 2 +- 3 files changed, 24 insertions(+), 19 deletions(-) delete mode 100644 PATCHES/amazon_ses-3417090-cron-queue-14.patch create mode 100644 PATCHES/amazon_ses-cron-queue-3417090-8.patch diff --git a/PATCHES/amazon_ses-3417090-cron-queue-14.patch b/PATCHES/amazon_ses-3417090-cron-queue-14.patch deleted file mode 100644 index 627b8177..00000000 --- a/PATCHES/amazon_ses-3417090-cron-queue-14.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff --git a/src/Plugin/QueueWorker/AmazonSesMailQueue.php b/src/Plugin/QueueWorker/AmazonSesMailQueue.php -index dc410504566451d20aec939de6953e6d1a6e9be9..fdc7af32ac6634c51283fb38f0227530a1772735 100644 ---- a/src/Plugin/QueueWorker/AmazonSesMailQueue.php -+++ b/src/Plugin/QueueWorker/AmazonSesMailQueue.php -@@ -29,7 +29,12 @@ class AmazonSesMailQueue extends QueueWorkerBase implements ContainerFactoryPlug - $plugin_definition - ); - -- $instance->setHandler($container->get('amazon_ses.handler')); -+ // Only set the handler if queueing is enabled to avoid an error when -+ // trying to run without config. -+ $enabled = \Drupal::config('amazon_ses.settings')->get('queue'); -+ if ($enabled) { -+ $instance->setHandler($container->get('amazon_ses.handler')); -+ } - - return $instance; - } diff --git a/PATCHES/amazon_ses-cron-queue-3417090-8.patch b/PATCHES/amazon_ses-cron-queue-3417090-8.patch new file mode 100644 index 00000000..93044ca9 --- /dev/null +++ b/PATCHES/amazon_ses-cron-queue-3417090-8.patch @@ -0,0 +1,23 @@ +diff --git a/amazon_ses.module b/amazon_ses.module +new file mode 100644 +index 0000000..b778644 +--- /dev/null ++++ b/amazon_ses.module +@@ -0,0 +1,17 @@ ++get('queue'); ++ ++ if (!$enabled && isset($queues['amazon_ses_mail_queue']['cron'])) { ++ unset($queues['amazon_ses_mail_queue']['cron']); ++ } ++} diff --git a/composer.patches.json b/composer.patches.json index 11c5e7e0..178d8685 100644 --- a/composer.patches.json +++ b/composer.patches.json @@ -1,7 +1,7 @@ { "patches": { "drupal/amazon_ses": { - "Cron fails on amazon_ses when not configured": "PATCHES/amazon_ses-3417090-cron-queue-14.patch" + "Cron fails on amazon_ses when not configured": "PATCHES/amazon_ses-cron-queue-3417090-8.patch" }, "drupal/default_content" : { "https://www.drupal.org/project/default_content/issues/2885285#comment-15342107": "https://www.drupal.org/files/issues/2023-12-01/i2885285-exporting-menu-link-2.patch"