diff --git a/src/EmbargoStorageTrait.php b/src/EmbargoStorageTrait.php index f8292ce..ef640ff 100644 --- a/src/EmbargoStorageTrait.php +++ b/src/EmbargoStorageTrait.php @@ -21,9 +21,9 @@ trait EmbargoStorageTrait { /** * The current request. * - * @var \Symfony\Component\HttpFoundation\Request + * @var \Symfony\Component\HttpFoundation\Request|null */ - protected Request $request; + protected ?Request $request; /** * The current user. @@ -95,13 +95,13 @@ protected function setUser(AccountInterface $user) : self { /** * The request visible to the trait. * - * @param \Symfony\Component\HttpFoundation\Request $request + * @param \Symfony\Component\HttpFoundation\Request|null $request * The request with which to evaluate. * * @return \Drupal\embargo\EmbargoStorageInterface|\Drupal\embargo\EmbargoStorageTrait * Fluent interface; the current object. */ - protected function setRequest(Request $request) : self { + protected function setRequest(?Request $request) : self { $this->request = $request; return $this; } diff --git a/src/EventSubscriber/EmbargoJoinProcessorEventSubscriber.php b/src/EventSubscriber/EmbargoJoinProcessorEventSubscriber.php index 64290cd..565db11 100644 --- a/src/EventSubscriber/EmbargoJoinProcessorEventSubscriber.php +++ b/src/EventSubscriber/EmbargoJoinProcessorEventSubscriber.php @@ -124,8 +124,8 @@ public function preQuery(PreQueryEvent $event) : void { ]), [ '!join' => $helper->join( - $get_field_name(NULL, $info['path']), - $get_field_name('entity:embargo', 'embargoed_node:entity:nid'), + $get_field_name(NULL, $info['embargo path']), + $get_field_name(NULL, $info['node path']), ), '!type_field' => $get_field_name('entity:embargo', 'expiration_type'), '!exempt_user_field' => $get_field_name('entity:embargo', 'exempt_users:entity:uid'), diff --git a/src/Plugin/search_api/processor/EmbargoJoinProcessor.php b/src/Plugin/search_api/processor/EmbargoJoinProcessor.php index f7109d9..5dc4f12 100644 --- a/src/Plugin/search_api/processor/EmbargoJoinProcessor.php +++ b/src/Plugin/search_api/processor/EmbargoJoinProcessor.php @@ -26,8 +26,8 @@ * @SearchApiProcessor( * id = "embargo_join_processor", * label = @Translation("Embargo access, join-wise"), - * description = @Translation("Add information regarding embargo access - * constraints."), stages = { + * description = @Translation("Add information regarding embargo access constraints."), + * stages = { * "add_properties" = 20, * "pre_index_save" = 20, * "preprocess_query" = 20, @@ -252,13 +252,15 @@ public function preprocessSearchQuery(QueryInterface $query) : void { if (in_array('entity:node', $this->index->getDatasourceIds())) { $queries['node'] = [ 'data sources' => ['entity:node'], - 'path' => 'embargo_node__node', + 'embargo path' => 'embargo_node__node', + 'node path' => 'embargo_node', ]; } if ($intersection = array_intersect($this->index->getDatasourceIds(), ['entity:media', 'entity:file'])) { $queries['file'] = [ 'data sources' => $intersection, - 'path' => 'embargo_node__file', + 'embargo path' => 'embargo_node__file', + 'node path' => 'embargo_node', ]; } diff --git a/src/Plugin/search_api/processor/EmbargoProcessor.php b/src/Plugin/search_api/processor/EmbargoProcessor.php index c20edf9..278f96f 100644 --- a/src/Plugin/search_api/processor/EmbargoProcessor.php +++ b/src/Plugin/search_api/processor/EmbargoProcessor.php @@ -25,9 +25,8 @@ * * @SearchApiProcessor( * id = "embargo_processor", - * label = @Translation("Embargo access"), - * description = @Translation("Add information regarding embargo access - * constraints."), + * label = @Translation("Embargo access (deprecated)"), + * description = @Translation("Add information regarding embargo access constraints."), * stages = { * "add_properties" = 20, * "pre_index_save" = 20,