Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.x]: Control Panel search returns all entries regardless of search term after upgrade to 5.5.10 #16457

Closed
watarutmnh opened this issue Jan 20, 2025 · 7 comments
Assignees
Labels

Comments

@watarutmnh
Copy link
Contributor

What happened?

Description

After upgrading from Craft CMS 5.5.6.1 to 5.5.10, the search functionality in the control panel is not working properly. When searching for entries using any search term, all entries are returned instead of being filtered according to the search criteria.

Steps to reproduce

  1. Log in to the Craft CMS control panel
  2. Navigate to the Entries section
  3. Enter any search term in the search field

Expected behavior

The search results should only display entries that match the entered search term, filtering out non-matching entries.

Actual behavior

All entries are displayed in the results regardless of the search term used, effectively making the search function non-operational. The system is not filtering or narrowing down the entries based on the search criteria.

Craft CMS version

5.5.10

PHP version

8.4.2

Operating system and version

Linux 6.8.0-1012-aws

Database type and version

MySQL 8.0.40

Image driver and version

GD 8.4.2

Installed plugins and versions

  • Amazon S3 | 2.2.1
  • Sentry SDK | 3.0.0
  • VIte | 5.0.1
@watarutmnh watarutmnh added the bug label Jan 20, 2025
@i-just
Copy link
Contributor

i-just commented Jan 20, 2025

Hi, thanks for reaching out! I’m not able to reproduce that. Could you send your composer.json, composer.lock and database export to [email protected] along with the exact search term that triggers this behaviour so that we can try to reproduce and dig deeper?

@tommysvr
Copy link

Received files in support. Specific use case was Japanese characters, and it looks like it's due to this change: 9a859d9 (#16430)

Steps to reproduce:

  1. Create an entry with the title 山田
  2. Search for the same term, all entries are returned
  3. Check searchindex in the database and 山田 doesn't exist as a keyword (the title & slug for the newly created elementId is blank)
  4. Comment out this line:
    $str = preg_replace('/[\x{80}-\x{10FFFF}]/u', '', $str);
  5. Resave the entry
  6. Search now returns just that entry; searchindex shows the keyword as expected

@watarutmnh
Copy link
Contributor Author

@tommysvr Thank you for investigating the issue. I have some additional information to share:

The files I sent were from Craft CMS version 5.6.0.2, and I noticed that the line mentioned in the comment:

$str = preg_replace('/[\x{80}-\x{10FFFF}]/u', '', $str);

as already been removed from this version. I attempted the suggested solution, but the issue with multibyte character searches persists.
Would it be possible to investigate further or suggest alternative solutions?

@i-just
Copy link
Contributor

i-just commented Jan 22, 2025

The code that Tommy mentioned is still there in 5.6.0.2, but it’s on line 71. That said, we’ll look into this and the original issue this code was fixing.

@i-just
Copy link
Contributor

i-just commented Jan 22, 2025

I’ve raised a PR for this and #16430. Once approved and released, you’ll need to resave affected elements (for example, running ./craft resave/entries --update-search-index=1 should take care of all the entries).

@watarutmnh
Copy link
Contributor Author

@i-just Thank you!

@brandonkelly
Copy link
Member

Craft 4.14.1 and 5.6.1 are out with that fix. Thanks again for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants