]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(textprocessing): accept scheduling a task if there are equivalent taskprocessing... backport/49260/stable30 49280/head
authorJulien Veyssier <julien-nc@posteo.net>
Wed, 13 Nov 2024 15:59:46 +0000 (16:59 +0100)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Thu, 14 Nov 2024 10:59:16 +0000 (10:59 +0000)
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
lib/private/TextProcessing/Manager.php

index 17778d310915edf807a8bd21530196900cc0468b..63157d3164a0c58cd8c975949d7c914ad13db2d4 100644 (file)
@@ -221,7 +221,11 @@ class Manager implements IManager {
                }
                $task->setStatus(OCPTask::STATUS_SCHEDULED);
                $providers = $this->getPreferredProviders($task);
-               if (count($providers) === 0) {
+               $equivalentTaskProcessingTypeAvailable = (
+                       isset(self::$taskProcessingCompatibleTaskTypes[$task->getType()])
+                       && isset($this->taskProcessingManager->getAvailableTaskTypes()[self::$taskProcessingCompatibleTaskTypes[$task->getType()]])
+               );
+               if (count($providers) === 0 && !$equivalentTaskProcessingTypeAvailable) {
                        throw new PreConditionNotMetException('No LanguageModel provider is installed that can handle this task');
                }
                [$provider,] = $providers;