Unverified Commit a3a8e460 authored by alexpott's avatar alexpott

Issue #3027595 by amateescu, pmelab: Incorrect blacklist condition in WorkspaceManager

parent f192f65b
......@@ -30,8 +30,8 @@ class WorkspaceManager implements WorkspaceManagerInterface {
* @var string[]
*/
protected $blacklist = [
'workspace_association',
'workspace',
'workspace_association' => 'workspace_association',
'workspace' => 'workspace',
];
/**
......@@ -132,11 +132,17 @@ public function __construct(RequestStack $request_stack, EntityTypeManagerInterf
* {@inheritdoc}
*/
public function isEntityTypeSupported(EntityTypeInterface $entity_type) {
if (!isset($this->blacklist[$entity_type->id()])
&& $entity_type->entityClassImplements(EntityPublishedInterface::class)
&& $entity_type->isRevisionable()) {
// First, check if we already determined whether this entity type is
// supported or not.
if (isset($this->blacklist[$entity_type->id()])) {
return FALSE;
}
if ($entity_type->entityClassImplements(EntityPublishedInterface::class) && $entity_type->isRevisionable()) {
return TRUE;
}
// This entity type can not belong to a workspace, add it to the blacklist.
$this->blacklist[$entity_type->id()] = $entity_type->id();
return FALSE;
}
......
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