Facet filter options aren't saved with the query, affecting email notifications

Created on 22 December 2022, almost 2 years ago
Updated 5 February 2024, 10 months ago

Problem/Motivation

It seems like the facets that are applied in the search aren't saved to the saved search query. This means that when the email is triggered, where the search query is used, it doesn't apply these facets and irrelevant results are returned for the email notification.

Steps to reproduce

  1. Save a search with facet filtering applied
  2. Save some content that would not be shown with the facet filtering applied in order to trigger the date field/last executed condition
  3. Trigger the email notifications and notice that the content is shown in the email when it wouldn't be shown in the search with the facet filtering applied

Proposed resolution

I'm not very familiar with the module but I think it's caused by this line in \Entity\SavedSearch.php within getCleanQueryForStorage:
$data = &$results->getAllExtraData();

If I comment this line and then save a new saved search, I can see the facet filter applied when looking at the query and then the email isn't triggered because there's no new content with the filtering applied.

🐛 Bug report
Status

Postponed: needs info

Version

1.0

Component

Code

Created by

🇬🇧United Kingdom joekers UK

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024