From aa8d25d5ed9bcd7fb71f4472a82c3f213c4a2c4b Mon Sep 17 00:00:00 2001 From: Marc Koch Date: Wed, 2 Apr 2025 09:22:59 +0200 Subject: [PATCH 1/4] =?UTF-8?q?=F0=9F=93=84=20fix=20some=20license=20and?= =?UTF-8?q?=20attribution=20stuff?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LICENSE.txt | 2 +- info.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/LICENSE.txt b/LICENSE.txt index 41c2284..d72e56f 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,5 +1,5 @@ Package: de.propeace.mailinglistsync -Copyright (C) 2025, FIXME +Copyright (C) 2025, Pro Peace Licensed under the GNU Affero Public License 3.0 (below). ------------------------------------------------------------------------------- diff --git a/info.xml b/info.xml index 41e1e8b..e90cf7f 100644 --- a/info.xml +++ b/info.xml @@ -7,12 +7,12 @@ Marc Koch - koch@forumZFD.de + marc.koch@propeace.de Maintainer - + https://git.propeace.de/ProPeace/de.propeace.mailinglistsync--> https://www.gnu.org/licenses/agpl-3.0.html From 60dd218688ae291f1bb67a570fb3d30314f6f6fd Mon Sep 17 00:00:00 2001 From: Marc Koch Date: Thu, 3 Apr 2025 11:48:12 +0200 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=90=9B=20change=20queue=20error=20mod?= =?UTF-8?q?e=20to=20'abort'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Civi/Mailinglistsync/QueueHelper.php | 6 +++--- mailinglistsync.php | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Civi/Mailinglistsync/QueueHelper.php b/Civi/Mailinglistsync/QueueHelper.php index 3988dbc..3f250b5 100644 --- a/Civi/Mailinglistsync/QueueHelper.php +++ b/Civi/Mailinglistsync/QueueHelper.php @@ -29,21 +29,21 @@ class QueueHelper { 'type' => 'SqlParallel', 'is_autorun' => FALSE, 'reset' => FALSE, - 'error' => 'drop', + 'error' => 'abort', ]); $this->eventQueue = \Civi::queue( 'propeace-mailinglist-event-queue', [ 'type' => 'SqlParallel', 'is_autorun' => FALSE, 'reset' => FALSE, - 'error' => 'drop', + 'error' => 'abort', ]); $this->emailQueue = \Civi::queue( 'propeace-mailinglist-email-queue', [ 'type' => 'SqlParallel', 'is_autorun' => FALSE, 'reset' => FALSE, - 'error' => 'drop', + 'error' => 'abort', ]); $this->groups = []; diff --git a/mailinglistsync.php b/mailinglistsync.php index 9f76eb8..4307197 100644 --- a/mailinglistsync.php +++ b/mailinglistsync.php @@ -129,7 +129,7 @@ function mailinglistsync_civicrm_validateForm($formName, &$fields, &$files, &$fo 'type' => 'SqlParallel', 'is_autorun' => FALSE, 'reset' => FALSE, - 'error' => 'drop', + 'error' => 'abort', ]); $queue->createItem(new CRM_Queue_Task( // callback @@ -145,7 +145,7 @@ function mailinglistsync_civicrm_validateForm($formName, &$fields, &$files, &$fo 'type' => 'SqlParallel', 'is_autorun' => FALSE, 'reset' => FALSE, - 'error' => 'drop', + 'error' => 'abort', ]); $queue->createItem(new CRM_Queue_Task( // callback @@ -326,7 +326,7 @@ function mailinglistsync_civicrm_postCommit(string $op, string $objectName, int 'type' => 'SqlParallel', 'is_autorun' => FALSE, 'reset' => FALSE, - 'error' => 'drop', + 'error' => 'abort', ]); $queue->createItem(new CRM_Queue_Task( // callback @@ -347,7 +347,7 @@ function mailinglistsync_civicrm_postCommit(string $op, string $objectName, int 'type' => 'SqlParallel', 'is_autorun' => FALSE, 'reset' => FALSE, - 'error' => 'drop', + 'error' => 'abort', ]); $queue->createItem(new CRM_Queue_Task( // callback @@ -374,7 +374,7 @@ function mailinglistsync_civicrm_postCommit(string $op, string $objectName, int 'type' => 'SqlParallel', 'is_autorun' => FALSE, 'reset' => FALSE, - 'error' => 'drop', + 'error' => 'abort', ]); $queue->createItem(new CRM_Queue_Task( // callback @@ -395,7 +395,7 @@ function mailinglistsync_civicrm_postCommit(string $op, string $objectName, int 'type' => 'SqlParallel', 'is_autorun' => FALSE, 'reset' => FALSE, - 'error' => 'drop', + 'error' => 'abort', ]); $queue->createItem(new CRM_Queue_Task( // callback @@ -416,7 +416,7 @@ function mailinglistsync_civicrm_postCommit(string $op, string $objectName, int 'type' => 'SqlParallel', 'is_autorun' => FALSE, 'reset' => FALSE, - 'error' => 'drop', + 'error' => 'abort', ]); $queue->createItem(new CRM_Queue_Task( // callback @@ -451,7 +451,7 @@ function mailinglistsync_civicrm_postCommit(string $op, string $objectName, int 'type' => 'SqlParallel', 'is_autorun' => FALSE, 'reset' => FALSE, - 'error' => 'drop', + 'error' => 'abort', ]); $queue->createItem(new CRM_Queue_Task( // callback From 927029c1fdcb857653be6506ca70fef294f8ac61 Mon Sep 17 00:00:00 2001 From: Marc Koch Date: Wed, 9 Apr 2025 11:30:20 +0200 Subject: [PATCH 3/4] =?UTF-8?q?=F0=9F=90=9B=20fix=20bug:=20missing=20permi?= =?UTF-8?q?ssions=20CustomField::get()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Civi/Mailinglistsync/BaseMailingList.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Civi/Mailinglistsync/BaseMailingList.php b/Civi/Mailinglistsync/BaseMailingList.php index c928635..a5b3a15 100644 --- a/Civi/Mailinglistsync/BaseMailingList.php +++ b/Civi/Mailinglistsync/BaseMailingList.php @@ -95,7 +95,7 @@ abstract class BaseMailingList */ static protected function getCustomFields(): array { - return CustomField::get() + return CustomField::get(FALSE) ->addSelect('*') ->addWhere('custom_group_id:name', '=', static::CUSTOM_GROUP_NAME) ->execute() From 2d7fae39ce52adcf717e4bf0e6b3d32f8cc22189 Mon Sep 17 00:00:00 2001 From: Marc Koch Date: Mon, 23 Jun 2025 11:46:40 +0200 Subject: [PATCH 4/4] =?UTF-8?q?=F0=9F=90=9B=20fix=20bug:=20QueueHelper::st?= =?UTF-8?q?oreEmail():=20$email=20null=20given?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Civi/Mailinglistsync/QueueHelper.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Civi/Mailinglistsync/QueueHelper.php b/Civi/Mailinglistsync/QueueHelper.php index 3f250b5..036ee2a 100644 --- a/Civi/Mailinglistsync/QueueHelper.php +++ b/Civi/Mailinglistsync/QueueHelper.php @@ -106,12 +106,14 @@ class QueueHelper { * Stores an email address in the queue helper singleton. * * @param \CRM_Queue_TaskContext $context - * @param string $email + * @param string|null $email * * @return bool */ - public static function storeEmail(\CRM_Queue_TaskContext $context, string $email): bool { - self::getInstance()->addToEmails($email); + public static function storeEmail(\CRM_Queue_TaskContext $context, ?string $email): bool { + if (!empty($email)) { + self::getInstance()->addToEmails($email); + } return TRUE; }