Compare commits

..

5 commits

5 changed files with 20 additions and 18 deletions

View file

@ -95,7 +95,7 @@ abstract class BaseMailingList
*/ */
static protected function getCustomFields(): array static protected function getCustomFields(): array
{ {
return CustomField::get() return CustomField::get(FALSE)
->addSelect('*') ->addSelect('*')
->addWhere('custom_group_id:name', '=', static::CUSTOM_GROUP_NAME) ->addWhere('custom_group_id:name', '=', static::CUSTOM_GROUP_NAME)
->execute() ->execute()

View file

@ -29,21 +29,21 @@ class QueueHelper {
'type' => 'SqlParallel', 'type' => 'SqlParallel',
'is_autorun' => FALSE, 'is_autorun' => FALSE,
'reset' => FALSE, 'reset' => FALSE,
'error' => 'drop', 'error' => 'abort',
]); ]);
$this->eventQueue = \Civi::queue( $this->eventQueue = \Civi::queue(
'propeace-mailinglist-event-queue', [ 'propeace-mailinglist-event-queue', [
'type' => 'SqlParallel', 'type' => 'SqlParallel',
'is_autorun' => FALSE, 'is_autorun' => FALSE,
'reset' => FALSE, 'reset' => FALSE,
'error' => 'drop', 'error' => 'abort',
]); ]);
$this->emailQueue = \Civi::queue( $this->emailQueue = \Civi::queue(
'propeace-mailinglist-email-queue', [ 'propeace-mailinglist-email-queue', [
'type' => 'SqlParallel', 'type' => 'SqlParallel',
'is_autorun' => FALSE, 'is_autorun' => FALSE,
'reset' => FALSE, 'reset' => FALSE,
'error' => 'drop', 'error' => 'abort',
]); ]);
$this->groups = []; $this->groups = [];
@ -106,12 +106,14 @@ class QueueHelper {
* Stores an email address in the queue helper singleton. * Stores an email address in the queue helper singleton.
* *
* @param \CRM_Queue_TaskContext $context * @param \CRM_Queue_TaskContext $context
* @param string $email * @param string|null $email
* *
* @return bool * @return bool
*/ */
public static function storeEmail(\CRM_Queue_TaskContext $context, string $email): bool { public static function storeEmail(\CRM_Queue_TaskContext $context, ?string $email): bool {
self::getInstance()->addToEmails($email); if (!empty($email)) {
self::getInstance()->addToEmails($email);
}
return TRUE; return TRUE;
} }

View file

@ -1,5 +1,5 @@
Package: de.propeace.mailinglistsync Package: de.propeace.mailinglistsync
Copyright (C) 2025, FIXME <FIXME> Copyright (C) 2025, Pro Peace <info@propeace.de>
Licensed under the GNU Affero Public License 3.0 (below). Licensed under the GNU Affero Public License 3.0 (below).
------------------------------------------------------------------------------- -------------------------------------------------------------------------------

View file

@ -7,12 +7,12 @@
<authors> <authors>
<author> <author>
<name>Marc Koch</name> <name>Marc Koch</name>
<email>koch@forumZFD.de</email> <email>marc.koch@propeace.de</email>
<role>Maintainer</role> <role>Maintainer</role>
</author> </author>
</authors> </authors>
<urls> <urls>
<!-- <url desc="Main Extension Page">https://FIXME</url>--> <url desc="Main Extension Page">https://git.propeace.de/ProPeace/de.propeace.mailinglistsync</url>-->
<!-- <url desc="Documentation">https://FIXME</url>--> <!-- <url desc="Documentation">https://FIXME</url>-->
<!-- <url desc="Support">https://FIXME</url>--> <!-- <url desc="Support">https://FIXME</url>-->
<url desc="Licensing">https://www.gnu.org/licenses/agpl-3.0.html</url> <url desc="Licensing">https://www.gnu.org/licenses/agpl-3.0.html</url>

View file

@ -129,7 +129,7 @@ function mailinglistsync_civicrm_validateForm($formName, &$fields, &$files, &$fo
'type' => 'SqlParallel', 'type' => 'SqlParallel',
'is_autorun' => FALSE, 'is_autorun' => FALSE,
'reset' => FALSE, 'reset' => FALSE,
'error' => 'drop', 'error' => 'abort',
]); ]);
$queue->createItem(new CRM_Queue_Task( $queue->createItem(new CRM_Queue_Task(
// callback // callback
@ -145,7 +145,7 @@ function mailinglistsync_civicrm_validateForm($formName, &$fields, &$files, &$fo
'type' => 'SqlParallel', 'type' => 'SqlParallel',
'is_autorun' => FALSE, 'is_autorun' => FALSE,
'reset' => FALSE, 'reset' => FALSE,
'error' => 'drop', 'error' => 'abort',
]); ]);
$queue->createItem(new CRM_Queue_Task( $queue->createItem(new CRM_Queue_Task(
// callback // callback
@ -326,7 +326,7 @@ function mailinglistsync_civicrm_postCommit(string $op, string $objectName, int
'type' => 'SqlParallel', 'type' => 'SqlParallel',
'is_autorun' => FALSE, 'is_autorun' => FALSE,
'reset' => FALSE, 'reset' => FALSE,
'error' => 'drop', 'error' => 'abort',
]); ]);
$queue->createItem(new CRM_Queue_Task( $queue->createItem(new CRM_Queue_Task(
// callback // callback
@ -347,7 +347,7 @@ function mailinglistsync_civicrm_postCommit(string $op, string $objectName, int
'type' => 'SqlParallel', 'type' => 'SqlParallel',
'is_autorun' => FALSE, 'is_autorun' => FALSE,
'reset' => FALSE, 'reset' => FALSE,
'error' => 'drop', 'error' => 'abort',
]); ]);
$queue->createItem(new CRM_Queue_Task( $queue->createItem(new CRM_Queue_Task(
// callback // callback
@ -374,7 +374,7 @@ function mailinglistsync_civicrm_postCommit(string $op, string $objectName, int
'type' => 'SqlParallel', 'type' => 'SqlParallel',
'is_autorun' => FALSE, 'is_autorun' => FALSE,
'reset' => FALSE, 'reset' => FALSE,
'error' => 'drop', 'error' => 'abort',
]); ]);
$queue->createItem(new CRM_Queue_Task( $queue->createItem(new CRM_Queue_Task(
// callback // callback
@ -395,7 +395,7 @@ function mailinglistsync_civicrm_postCommit(string $op, string $objectName, int
'type' => 'SqlParallel', 'type' => 'SqlParallel',
'is_autorun' => FALSE, 'is_autorun' => FALSE,
'reset' => FALSE, 'reset' => FALSE,
'error' => 'drop', 'error' => 'abort',
]); ]);
$queue->createItem(new CRM_Queue_Task( $queue->createItem(new CRM_Queue_Task(
// callback // callback
@ -416,7 +416,7 @@ function mailinglistsync_civicrm_postCommit(string $op, string $objectName, int
'type' => 'SqlParallel', 'type' => 'SqlParallel',
'is_autorun' => FALSE, 'is_autorun' => FALSE,
'reset' => FALSE, 'reset' => FALSE,
'error' => 'drop', 'error' => 'abort',
]); ]);
$queue->createItem(new CRM_Queue_Task( $queue->createItem(new CRM_Queue_Task(
// callback // callback
@ -451,7 +451,7 @@ function mailinglistsync_civicrm_postCommit(string $op, string $objectName, int
'type' => 'SqlParallel', 'type' => 'SqlParallel',
'is_autorun' => FALSE, 'is_autorun' => FALSE,
'reset' => FALSE, 'reset' => FALSE,
'error' => 'drop', 'error' => 'abort',
]); ]);
$queue->createItem(new CRM_Queue_Task( $queue->createItem(new CRM_Queue_Task(
// callback // callback