Skip to content

Commit

Permalink
DDST-382: Handle warning during search indexing
Browse files Browse the repository at this point in the history
  • Loading branch information
Prashant-bd committed Jul 30, 2024
1 parent 6a25594 commit ad31c3c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Plugin/search_api/processor/EmbargoJoinProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,12 @@ protected function doAddNodeField(ItemInterface $item, EntityInterface $entity)
*/
protected function doAddEmbargoField(ItemInterface $item, EntityInterface $entity) : void {
assert($entity instanceof EmbargoInterface);

// Early return if there is no embargoed node.
if ($entity->getEmbargoedNode() === NULL) {
return;
}

$paths = match ($entity->getEmbargoType()) {
EmbargoInterface::EMBARGO_TYPE_FILE => [static::EMBARGO_FIELD_FILE],
EmbargoInterface::EMBARGO_TYPE_NODE => [static::EMBARGO_FIELD_NODE, static::EMBARGO_FIELD_FILE],
Expand Down

0 comments on commit ad31c3c

Please sign in to comment.