From 3d25ad7de4fdbb3eba2cde2a62422e6be5d79a0a Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Tue, 25 Aug 2026 22:57:22 +0000
Subject: [PATCH] =It's been a minute. I went through the Routes and associated Managers and ensured they played together well. Reworked the Cache.php, and I think I caught all the references. Moving away from JVBase() root class, to individuall classes that are Instanced. Double checked for the ABSPATH check in every file, and added index.php to every directory that didn't already have it. Also still working on the MenuBlock to work with WooCommerce for now for Northeh
---
inc/managers/queue/executors/IntegrationExecutor.php | 27 ++++++++++-----------------
1 files changed, 10 insertions(+), 17 deletions(-)
diff --git a/inc/managers/queue/executors/IntegrationExecutor.php b/inc/managers/queue/executors/IntegrationExecutor.php
index ea79960..9af8556 100644
--- a/inc/managers/queue/executors/IntegrationExecutor.php
+++ b/inc/managers/queue/executors/IntegrationExecutor.php
@@ -18,7 +18,7 @@
* {integration}_sync_from, {integration}_sync_customer, etc.
*
* Registration (in Integrations::registerAdditionalHooks):
- * $queue = JVB()->queue();
+ * $queue = Queue::getInstance();
* $queue->registry()->register('helcim_sync_to', new TypeConfig(
* executor: new IntegrationExecutor(),
* chunkKey: 'items',
@@ -86,9 +86,6 @@
*/
private function parseOperationType(string $type): array
{
- // Remove BASE prefix if present (e.g. 'jvb_helcim_sync_to' → 'helcim_sync_to')
- $type = str_replace(BASE, '', $type);
-
$pos = strpos($type, '_');
if ($pos === false) {
throw new Exception("Invalid integration operation type: {$type}");
@@ -103,21 +100,12 @@
/**
* Resolve integration instance, optionally for a specific user
*/
- private function resolveIntegration(string $serviceName, int $userId): ?object
+ private function resolveIntegration(string $serviceName, ?int $userId = null): ?object
{
- if (!isset($this->integrationCache[$serviceName])) {
- $this->integrationCache[$serviceName] = JVB()->connect($serviceName);
+ if ($userId === 0) {
+ $userId = null;
}
-
- $integration = $this->integrationCache[$serviceName];
-
- // If operation has a user context, re-instantiate for that user
- if ($integration && $userId) {
- $class = get_class($integration);
- return new $class($userId);
- }
-
- return $integration;
+ return JVB()->connect($serviceName, $userId);
}
/*****************************************************************
@@ -137,6 +125,11 @@
return new Result(outcome: 'success', result: ['synced' => [], 'message' => 'No items to sync']);
}
+ if ($integration->hasBatchUpdate()) {
+ $result = $integration->updateBatchToService($data['items']);
+ return new Result(outcome: $result['outcome'], result: $result['result']);
+ }
+
foreach ($items as $postID) {
try {
$result = $integration->syncPostToService((int)$postID);
--
Gitblit v1.10.0