Unverified Commit 91bbb61c authored by alexpott's avatar alexpott

Issue #3065586 by Charlie ChX Negyesi, alexpott: ConditionManager::execute()...

Issue #3065586 by Charlie ChX Negyesi, alexpott: ConditionManager::execute() implementation doesn't conform to the interface
parent 7daf1e69
......@@ -4,6 +4,7 @@
use Drupal\Component\Plugin\CategorizingPluginManagerInterface;
use Drupal\Core\Cache\CacheBackendInterface;
use Drupal\Core\Executable\ExecutableException;
use Drupal\Core\Executable\ExecutableManagerInterface;
use Drupal\Core\Executable\ExecutableInterface;
use Drupal\Core\Extension\ModuleHandlerInterface;
......@@ -71,8 +72,11 @@ public function createInstance($plugin_id, array $configuration = []) {
* {@inheritdoc}
*/
public function execute(ExecutableInterface $condition) {
$result = $condition->evaluate();
return $condition->isNegated() ? !$result : $result;
if ($condition instanceof ConditionInterface) {
$result = $condition->evaluate();
return $condition->isNegated() ? !$result : $result;
}
throw new ExecutableException("This manager object can only execute condition plugins");
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment