From 9c766cf03faa10584255458120d8404ddc05c47d Mon Sep 17 00:00:00 2001
From: Arthur Schiwon <blizzz@arthur-schiwon.de>
Date: Tue, 29 Oct 2019 17:57:53 +0100
Subject: [PATCH] do not break on Checkers that do not need specific context
 info

request time, for example

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
---
 apps/workflowengine/lib/Service/RuleMatcher.php | 5 +----
 lib/public/WorkflowEngine/IEntityCheck.php      | 3 ---
 2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/apps/workflowengine/lib/Service/RuleMatcher.php b/apps/workflowengine/lib/Service/RuleMatcher.php
index bcfcd5dd219..95c68b63370 100644
--- a/apps/workflowengine/lib/Service/RuleMatcher.php
+++ b/apps/workflowengine/lib/Service/RuleMatcher.php
@@ -24,12 +24,9 @@ declare(strict_types=1);
 
 namespace OCA\WorkflowEngine\Service;
 
-use OCA\WorkflowEngine\AppInfo\Application;
-use OCA\WorkflowEngine\Entity\File;
 use OCA\WorkflowEngine\Helper\ScopeContext;
 use OCA\WorkflowEngine\Manager;
 use OCP\AppFramework\QueryException;
-use OCP\Files\Node;
 use OCP\Files\Storage\IStorage;
 use OCP\IL10N;
 use OCP\IServerContainer;
@@ -128,7 +125,7 @@ class RuleMatcher implements IRuleMatcher {
 				list($entity, $subject) = $entityInfo;
 				$checkInstance->setEntitySubject($entity, $subject);
 			}
-		} else {
+		} else if(!$checkInstance instanceof ICheck) {
 			// Check is invalid
 			throw new \UnexpectedValueException($this->l->t('Check %s is invalid or does not exist', $check['class']));
 		}
diff --git a/lib/public/WorkflowEngine/IEntityCheck.php b/lib/public/WorkflowEngine/IEntityCheck.php
index 7a4df0afd5f..d90535b4c99 100644
--- a/lib/public/WorkflowEngine/IEntityCheck.php
+++ b/lib/public/WorkflowEngine/IEntityCheck.php
@@ -24,9 +24,6 @@ declare(strict_types=1);
 
 namespace OCP\WorkflowEngine;
 
-
-use OCP\Files\Storage\IStorage;
-
 /**
  * Interface IFileCheck
  *
-- 
GitLab