diff --git a/app/Jobs/UpdateSite.php b/app/Jobs/UpdateSite.php index 8e039af..86b79a4 100644 --- a/app/Jobs/UpdateSite.php +++ b/app/Jobs/UpdateSite.php @@ -142,7 +142,7 @@ public function handle(): void // Run the postupdate steps $postUpdateResult = $connection->finalizeUpdate(["fromVersion" => $healthResult->cms_version]); - if (!$postUpdateResult->success) { + if (!$postUpdateResult->success && !$postUpdateResult->hasIgnorableError()) { throw new UpdateException( "finalize", "Update for site failed in postprocessing: " . $this->site->id . ", errors: " . json_encode($postUpdateResult->errors), diff --git a/app/RemoteSite/Responses/FinalizeUpdate.php b/app/RemoteSite/Responses/FinalizeUpdate.php index e8c651c..6dd944c 100644 --- a/app/RemoteSite/Responses/FinalizeUpdate.php +++ b/app/RemoteSite/Responses/FinalizeUpdate.php @@ -11,4 +11,23 @@ public function __construct( public ?array $errors = null, ) { } + + public function hasIgnorableError(): bool + { + if (is_null($this->errors)) { + return false; + } + + $errorString = (string) json_encode($this->errors); + + if (str_contains($errorString, 'Undefined constant') && str_contains($errorString, 'T4PATH_MEDIA')) { + return true; + } + + if (str_contains($errorString, 'Error on updating manifest cache') && str_contains($errorString, 'T4PATH_MEDIA')) { + return true; + } + + return false; + } }