diff --git a/src/packages/plg_task_mokowaassync/src/Extension/ContentSync.php b/src/packages/plg_task_mokowaassync/src/Extension/ContentSync.php index 8c566399..6e2be642 100644 --- a/src/packages/plg_task_mokowaassync/src/Extension/ContentSync.php +++ b/src/packages/plg_task_mokowaassync/src/Extension/ContentSync.php @@ -80,11 +80,19 @@ final class ContentSync extends CMSPlugin implements SubscriberInterface return Status::KNOCKOUT; } + $healthToken = trim($params->health_token ?? ''); + + if (empty($healthToken)) + { + $this->logTask('Target health token not configured — cannot sync'); + + return Status::KNOCKOUT; + } + $this->targetUrl = $targetUrl; $this->healthToken = $healthToken; $errors = 0; $synced = []; - $apiBase = $targetUrl . '/api/index.php/v1'; // Bulk-clear selected content types on target before pushing $clearTypes = []; @@ -109,15 +117,6 @@ final class ContentSync extends CMSPlugin implements SubscriberInterface $clearTypes[] = 'modules'; } - $healthToken = trim($params->health_token ?? ''); - - if (empty($healthToken)) - { - $this->logTask('Target health token not configured — cannot sync'); - - return Status::KNOCKOUT; - } - if (!empty($clearTypes)) { $clearResult = $this->bulkClear($targetUrl, $healthToken, $clearTypes);