Skip to content

Commit

Permalink
Merge pull request #21 from adam-vessey/fixes/general-conditions
Browse files Browse the repository at this point in the history
Fix for lack of 3-valued logic.
  • Loading branch information
jordandukart authored May 27, 2021
2 parents 5de506d + 8d51992 commit 26e5e05
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Plugin/Condition/EntityHasIdentifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@ public static function create(ContainerInterface $container, array $configuratio
* {@inheritdoc}
*/
public function evaluate(): bool {
if (empty($this->configuration['identifier'])) {
// XXX: We are not configured... should have no influence on things;
// however, they have not implemented 3-value logic, so we have to return
// TRUE to stay out of the way.
return TRUE;
}

$entity = $this->getContextValue('entity');
if ($entity instanceof FieldableEntityInterface) {
$identifier = $this->entityTypeManager->getStorage('dgiactions_identifier')->load($this->configuration['identifier']);
Expand Down

0 comments on commit 26e5e05

Please sign in to comment.