Skip to content

Commit

Permalink
fix dealing with events against OCP\EventDispatcher\GenericEvent
Browse files Browse the repository at this point in the history
Signed-off-by: Arthur Schiwon <[email protected]>
  • Loading branch information
blizzz committed Jan 16, 2020
1 parent ebf0d40 commit 3d468f1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/Operation.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
use OCA\WorkflowScript\BackgroundJobs\Launcher;
use OCP\BackgroundJob\IJobList;
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\GenericEvent;
use OCP\Files\Folder;
use OCP\Files\InvalidPathException;
use OCP\Files\IRootFolder;
Expand All @@ -40,7 +41,7 @@
use OCP\WorkflowEngine\IManager;
use OCP\WorkflowEngine\IRuleMatcher;
use OCP\WorkflowEngine\ISpecificOperation;
use Symfony\Component\EventDispatcher\GenericEvent;
use Symfony\Component\EventDispatcher\GenericEvent as LegacyGenericEvent;

class Operation implements ISpecificOperation {

Expand Down Expand Up @@ -172,7 +173,9 @@ public function isAvailableForScope(int $scope): bool {
}

public function onEvent(string $eventName, Event $event, IRuleMatcher $ruleMatcher): void {
if (!$event instanceof GenericEvent && !$event instanceof MapperEvent) {
if (!$event instanceof GenericEvent
&& !$event instanceof LegacyGenericEvent
&& !$event instanceof MapperEvent) {
return;
}
try {
Expand Down

0 comments on commit 3d468f1

Please sign in to comment.