From c89acb5aec681ebc88bc6a8eff8b0f25243ad5cd Mon Sep 17 00:00:00 2001
From: Sebastian Kehr <kese@users.noreply.github.com>
Date: Tue, 27 Feb 2018 14:23:34 +0100
Subject: [PATCH] Allow delegator factories upon plugin validation. (#1125)

---
 .../src/VuFind/ServiceManager/AbstractPluginManager.php    | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/module/VuFind/src/VuFind/ServiceManager/AbstractPluginManager.php b/module/VuFind/src/VuFind/ServiceManager/AbstractPluginManager.php
index 6e83f1039bc..4c555e8237f 100644
--- a/module/VuFind/src/VuFind/ServiceManager/AbstractPluginManager.php
+++ b/module/VuFind/src/VuFind/ServiceManager/AbstractPluginManager.php
@@ -28,6 +28,7 @@
 namespace VuFind\ServiceManager;
 use Zend\ServiceManager\AbstractPluginManager as Base,
     Zend\ServiceManager\ConfigInterface,
+    Zend\ServiceManager\DelegatorFactoryInterface,
     Zend\ServiceManager\Exception\RuntimeException as ServiceManagerRuntimeException;
 
 /**
@@ -74,8 +75,12 @@ abstract class AbstractPluginManager extends Base
      */
     public function validatePlugin($plugin)
     {
+        if ($plugin instanceof DelegatorFactoryInterface) {
+            return;
+        }
+        
         $expectedInterface = $this->getExpectedInterface();
-        if (!($plugin instanceof $expectedInterface)) {
+        if (!$plugin instanceof $expectedInterface) {
             throw new ServiceManagerRuntimeException(
                 'Plugin ' . get_class($plugin) . ' does not belong to '
                 . $expectedInterface
-- 
GitLab