|
17 | 17 | use Fau\DegreeProgram\Common\Application\Filter\SubjectGroupFilter;
|
18 | 18 | use Fau\DegreeProgram\Common\Application\Filter\TeachingLanguageFilter;
|
19 | 19 | use Fau\DegreeProgram\Common\Application\Repository\CollectionCriteria;
|
20 |
| -use Fau\DegreeProgram\Common\Domain\CampoKeys; |
21 | 20 | use Fau\DegreeProgram\Common\Domain\DegreeProgram;
|
22 | 21 | use Fau\DegreeProgram\Common\Domain\MultilingualString;
|
23 | 22 | use Fau\DegreeProgram\Common\Infrastructure\Content\PostType\DegreeProgramPostType;
|
24 | 23 | use Fau\DegreeProgram\Common\Infrastructure\Content\Taxonomy\BachelorOrTeachingDegreeAdmissionRequirementTaxonomy;
|
25 | 24 | use Fau\DegreeProgram\Common\Infrastructure\Content\Taxonomy\MasterDegreeAdmissionRequirementTaxonomy;
|
26 | 25 | use Fau\DegreeProgram\Common\Infrastructure\Content\Taxonomy\TaxonomiesList;
|
27 |
| -use Fau\DegreeProgram\Common\Infrastructure\Content\Taxonomy\TeachingDegreeHigherSemesterAdmissionRequirementTaxonomy; |
28 |
| -use RuntimeException; |
29 | 26 | use WP_Term;
|
30 | 27 |
|
31 | 28 | /**
|
@@ -272,19 +269,19 @@ private function applySearchFilter(SearchKeywordFilter $filter, WpQueryArgs $que
|
272 | 269 | {
|
273 | 270 | $keywords = array_filter(array_map('trim', explode(' ', $filter->value())));
|
274 | 271 | $metaKeyPrefix = 'fau_degree_program_searchable_content_';
|
275 |
| - $metaKeys = $languageCode |
| 272 | + $metaKeys = is_string($languageCode) && $languageCode |
276 | 273 | ? [$metaKeyPrefix . $languageCode]
|
277 | 274 | : [$metaKeyPrefix . MultilingualString::EN, $metaKeyPrefix . MultilingualString::DE];
|
278 | 275 |
|
279 |
| - $metaQuery = array_reduce($keywords, static function ($metaQuery, $keyword) use ($metaKeys): array { |
280 |
| - $keywordConditions = array_values(array_map( |
| 276 | + $metaQuery = array_reduce($keywords, static function (array $metaQuery, string $keyword) use ($metaKeys): array { |
| 277 | + $keywordConditions = array_map( |
281 | 278 | static fn($key) => [
|
282 | 279 | 'key' => $key,
|
283 | 280 | 'value' => $keyword,
|
284 | 281 | 'compare' => 'LIKE',
|
285 | 282 | ],
|
286 | 283 | $metaKeys
|
287 |
| - )); |
| 284 | + ); |
288 | 285 |
|
289 | 286 | $metaQuery[] = ['relation' => 'OR'] + $keywordConditions;
|
290 | 287 |
|
|
0 commit comments