Skip to content
Snippets Groups Projects
Commit a9ec6537 authored by Claudiu Cristea's avatar Claudiu Cristea
Browse files

Merge branch 'ISAICP-7795' into 'EPIC-7450'

ISAICP-7795: Overview 'Content listing' bug in show archive.

See merge request digit/digit-joinup-dev!716
parents 8464fa4f f41fc235
No related branches found
No related tags found
No related merge requests found
...@@ -11,21 +11,30 @@ Feature: Global search with archive content ...@@ -11,21 +11,30 @@ Feature: Global search with archive content
And the following <group type>s: And the following <group type>s:
| title | description | state | | title | description | state |
| Some <group type> | Description | validated | | Some <group type> | Description | validated |
| Rare <group type> | Description | validated |
And event content: And event content:
| title | short title | body | spatial coverage | agenda | location | organisation | scope | <group type> | state | | title | short title | body | spatial coverage | agenda | location | organisation | scope | <group type> | state |
| Event 1 | Event 1 | Some body | Greece | Some agenta | Some place | European Commission | International | Some <group type> | validated | | Event 1 | Event 1 | Some body | Greece | Some agenta | Some place | European Commission | International | Some <group type> | validated |
| Event 2 | Event 2 | Some body | Greece | Some agenta | Some place | European Commission | International | Rare <group type> | validated |
| Event 3 | Event 3 | Some body | Greece | Some agenta | Some place | European Commission | International | Rare <group type> | validated |
| Event 4 | Event 4 | Some body | Greece | Some agenta | Some place | European Commission | International | Rare <group type> | validated |
And document content: And document content:
| title | document type | short title | body | spatial coverage | <group type> | state | | title | document type | short title | body | spatial coverage | <group type> | state |
| Some document 1 | Document | Some document 1 | Some body | Luxembourg | Some <group type> | validated | | Some document 1 | Document | Some document 1 | Some body | Luxembourg | Some <group type> | validated |
When the "Some <group type>" <group type> is configured to show "All" community content in the overview When the "Some <group type>" <group type> is configured to show "All" community content in the overview
And the "Some <group type>" <group type> is configured to show the "<bundle label> content archived toggle" facet in the "Top" region And the "Some <group type>" <group type> is configured to show the "<bundle label> content archived toggle" facet in the "Top" region
When the "Rare <group type>" <group type> is configured to show "All" community content in the overview
And the "Rare <group type>" <group type> is configured to show the "<bundle label> content archived toggle" facet in the "Top" region
When I go to the homepage of the "Some <group type>" <group type> When I go to the homepage of the "Some <group type>" <group type>
Then I should not see the "<group type> content archived toggle" facet Then I should not see the "<group type> content archived toggle" facet
And I should see the following tiles in the correct order: And I should see the following tiles in the correct order:
| Event 1 | | Event 1 |
| Some document 1 | | Some document 1 |
When I go to the homepage of the "Rare <group type>" <group type>
Then I should not see the "<group type> content archived toggle" facet
Given event content: Given event content:
| title | short title | body | spatial coverage | agenda | location | organisation | scope | <group type> | state | | title | short title | body | spatial coverage | agenda | location | organisation | scope | <group type> | state |
| Event 2 | Event 2 | Some body | Greece | Some agenta | Some place | European Commission | International | Some <group type> | archived | | Event 2 | Event 2 | Some body | Greece | Some agenta | Some place | European Commission | International | Some <group type> | archived |
...@@ -53,6 +62,9 @@ Feature: Global search with archive content ...@@ -53,6 +62,9 @@ Feature: Global search with archive content
And I should not see the "Event 1" tile And I should not see the "Event 1" tile
And I should not see the "Some document 1" tile And I should not see the "Some document 1" tile
When I go to the homepage of the "Rare <group type>" <group type>
Then I should not see the "<group type> content archived toggle" facet
Examples: Examples:
| bundle label | group type | | bundle label | group type |
| Collection | collection | | Collection | collection |
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
use Drupal\facets\FacetInterface; use Drupal\facets\FacetInterface;
use Drupal\facets\FacetManager\DefaultFacetManager; use Drupal\facets\FacetManager\DefaultFacetManager;
use Drupal\joinup_user\Entity\JoinupUserInterface;
use Drupal\paragraphs\ParagraphInterface; use Drupal\paragraphs\ParagraphInterface;
use Drupal\search_api\Event\QueryPreExecuteEvent; use Drupal\search_api\Event\QueryPreExecuteEvent;
use Drupal\search_api\Event\SearchApiEvents; use Drupal\search_api\Event\SearchApiEvents;
...@@ -107,22 +106,6 @@ public function paragraphContentListingQueryAlter(QueryPreExecuteEvent $event): ...@@ -107,22 +106,6 @@ public function paragraphContentListingQueryAlter(QueryPreExecuteEvent $event):
$this->getConditionGroupInterfaces($query); $this->getConditionGroupInterfaces($query);
} }
/**
* Reacts to the query alter event for user content listings.
*
* @param \Drupal\search_api\Event\QueryPreExecuteEvent $event
* The query alter event.
*/
public function userContentListingQueryAlter(QueryPreExecuteEvent $event): void {
$query = $event->getQuery();
$entity = $query->getOption('search_api_field entity');
if (!($entity instanceof JoinupUserInterface)) {
return;
}
$this->getConditionGroupInterfaces($query);
}
/** /**
* Add archive condition in query. * Add archive condition in query.
* *
......
...@@ -277,6 +277,7 @@ protected function getArchivedQuery(array $settings, SearchItemInterface $item): ...@@ -277,6 +277,7 @@ protected function getArchivedQuery(array $settings, SearchItemInterface $item):
} }
$hooks = [ $hooks = [
'search_api_field', 'search_api_field',
'search_api_field_' . $field_definition->getName(),
'search_api_field_' . $field_definition->getName() . '_archived', 'search_api_field_' . $field_definition->getName() . '_archived',
]; ];
foreach ($hooks as $hook) { foreach ($hooks as $hook) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment