Fix post-notification history subject search

We previously were looking for search term on the Newsletter table subject column. Unfortunately, post-notification and its history items sometimes contain both static text and dynamic text i.e., MailPoet shortcodes. This prevented the search from returning any useful results.

 The RenderedSubject on the Sending queues table includes both the static text and dynamic text, so we can look for the search term on it

MAILPOET-6072
This commit is contained in:
Oluwaseun Olorunsola
2024-06-13 15:35:14 +01:00
committed by Veljko V
parent aea6eb3dbb
commit ae275d0824
2 changed files with 17 additions and 6 deletions

View File

@@ -69,8 +69,10 @@ abstract class ListingRepository {
}
$search = $definition->getSearch();
$parameters = $definition->getParameters();
if ($search && strlen(trim($search)) > 0) {
$this->applySearch($queryBuilder, $search);
$this->applySearch($queryBuilder, $search, $parameters ?: []);
}
$filters = $definition->getFilters();
@@ -78,7 +80,6 @@ abstract class ListingRepository {
$this->applyFilters($queryBuilder, $filters);
}
$parameters = $definition->getParameters();
if ($parameters) {
$this->applyParameters($queryBuilder, $parameters);
}