Skip to content

Properly set search string in Global Search - #2763

Merged
ifox merged 2 commits into
area17:3.xfrom
nikhiltri:fix/global-search
Aug 19, 2025
Merged

Properly set search string in Global Search#2763
ifox merged 2 commits into
area17:3.xfrom
nikhiltri:fix/global-search

Conversation

@nikhiltri

Copy link
Copy Markdown
Contributor

Description

The cmsSearch() method in ModuleController uses the FreeTextSearch model and sets:

        $searchFilter->queryString($search);
        $searchFilter->searchColumns($fields);
        $searchFilter->searchQuery($query);

The FreeTextSearch model, however, has a condition that requires searchString to not be empty, and that value is never set in cmsSearch(). It gets set by the searchFor() method which never gets called.

Adding:

        $searchFilter->searchFor($search);

Makes global search work as expected for me.

Related Issues

Fixes #2762

@Tofandel

Tofandel commented Jul 31, 2025

Copy link
Copy Markdown
Contributor

You should replace queryString altogether with searchFor that was the wrong method and it does nothing in this context

Comment thread src/Repositories/ModuleRepository.php Outdated
Co-authored-by: Adrien Foulon <6115458+Tofandel@users.noreply.github.com>
@ifox
ifox merged commit 8239616 into area17:3.x Aug 19, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Global Search not properly getting search string

3 participants