Skip to content

SearchController should respect settings again #578

@julianhofmann

Description

@julianhofmann

The SearchController no longer passes any settings to the DayRepository, which means that the settings are no longer taken into account in the results.

In this specific case, we have expanded FlexForm with options that respond to the added option via a listener on ModifyQueriesOfSearchEventsEvent.
However, the $settings array in Event is always empty :-(

...unless the SearchController passes its settings to DayRepository:

After

    public function listSearchResultsAction(?Search $search = null): ResponseInterface
    {
        if ($search instanceof Search) {
            $this->dayRepository->setSettings($this->settings);
            $days = $this->dayRepository->searchEvents($search);

            $this->postProcessAndAssignFluidVariables([
                'days' => $days,
            ]);

            $this->cacheService->addPageCacheTagsByQuery($days->getQuery());
        }

        return $this->htmlResponse();
    }

Before

    public function listSearchResultsAction(?Search $search = null): ResponseInterface
    {
        if ($search instanceof Search) {
            $days = $this->dayRepository->searchEvents($search);

            $this->postProcessAndAssignFluidVariables([
                'days' => $days,
            ]);

            $this->cacheService->addPageCacheTagsByQuery($days->getQuery());
        }

        return $this->htmlResponse();
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions