Make WordPress Core

Opened 6 weeks ago

Last modified 6 weeks ago

#63209 new defect (bug)

The search engine for admin posts does not support quotes

Reported by: eddystile's profile eddystile Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Administration Keywords: needs-patch 2nd-opinion
Focuses: Cc:

Description (last modified by audrasjb)

If you search for an article name with quotation marks or apostrophes, the search returns no result.

Reproduct :

  • create a post with the following title : "New" a good post
  • Search "New" a good post on the Posts list screen
  • See there is no result

Attachments (1)

quotes_in_search.png (62.0 KB) - added by eddystile 6 weeks ago.

Download all attachments as: .zip

Change History (12)

#1 @audrasjb
6 weeks ago

  • Component changed from General to Administration
  • Description modified (diff)
  • Version 6.7.2 deleted

#2 follow-up: @debarghyabanerjee
6 weeks ago

I noticed that your site language is set to French. When creating a new post, you are adding the title in English, which results in it being stored in English in the database. When you try to search using the French title displayed on the post list, the default search query doesn't automatically translate the search term. As a result, you are not getting any results because it is trying to find "New A good post" in the database instead of "New" a good post.

#3 follow-up: @abcd95
6 weeks ago

Hi @eddystile, Thanks for raising the issue.

I observed a different behaviour than what you reported. I was able to see the post in the search results. As correctly mentioned by @debarghyabanerjee, when the language and translation is consistent, you can correctly get the results.

https://i.ibb.co/MDcfHj1Q/image.png

#4 in reply to: ↑ 2 @eddystile
6 weeks ago

Replying to debarghyabanerjee:

I noticed that your site language is set to French. When creating a new post, you are adding the title in English, which results in it being stored in English in the database. When you try to search using the French title displayed on the post list, the default search query doesn't automatically translate the search term. As a result, you are not getting any results because it is trying to find "New A good post" in the database instead of "New" a good post.

Ok, you are right. But i don't understand, the database understand the language ?
If i want to write '"New" Mon dernier article', it will be stored in 'english' ?

#5 in reply to: ↑ 3 @eddystile
6 weeks ago

Replying to abcd95:

Hi @eddystile, Thanks for raising the issue.

I observed a different behaviour than what you reported. I was able to see the post in the search results. As correctly mentioned by @debarghyabanerjee, when the language and translation is consistent, you can correctly get the results.

https://i.ibb.co/MDcfHj1Q/image.png

So if you create a post '"My post is "de la haute couture"' will you be able to find it ?

#6 @debarghyabanerjee
6 weeks ago

Hi @eddystile,

Apologies if my previous reply was unclear. To clarify, when you saved the post, the title was "New" a good post, which was written in English and stored exactly as is in the database. If you had saved the title as « New » A good post, you would have found it by searching.

The key point is that whatever you enter as the title is what gets saved in the database.

The translated quotation marks you see in the Post List Table are fetched dynamically at runtime and updated by the wptexturize() function hooked to the the_title action.

I hope this clears up your doubt! Please let me know if you need further clarification.

This ticket was mentioned in Slack in #core-test by oglekler. View the logs.


6 weeks ago

#8 @SirLouen
6 weeks ago

  • Keywords needs-patch added

Reproduction Report

Description

✅ This report validates that the issue can be reproduced.

Environment

  • WordPress: 6.9-alpha-60093-src
  • PHP: 8.2.28
  • Server: nginx/1.27.4
  • Database: mysqli (Server: 8.0.41 / Client: mysqlnd 8.2.28)
  • Browser: Chrome 134.0.0.0
  • OS: Windows 10/11
  • Theme: Twenty Twenty-Five 1.1
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.0

Actual Results

  1. ✅ Error condition occurs (reproduced).

Additional comments

As commented in chat with @OGlekler, the thing is that searching simply without the quotes, returns the same results, which could be acceptable to some extentent

But still, I think that not being able to use quotes on the search bar, regardless if they are being used as an exact match operator or not, is a sign of a bug on this topic. Some patch could be delivered for this purpose.

Things can go even more crazy:

Conclusion

This admin search bar, should be reviewed and patched.

Supplemental Artifacts

https://i.imgur.com/54GQqww.png
https://i.imgur.com/g60pvSX.png

Last edited 6 weeks ago by SirLouen (previous) (diff)

#9 follow-up: @debarghyabanerjee
6 weeks ago

Hi @SirLouen, I am not sure if this is an error or bug

#10 @debarghyabanerjee
6 weeks ago

  • Keywords 2nd-opinion added

#11 in reply to: ↑ 9 @SirLouen
6 weeks ago

Replying to debarghyabanerjee:

Hi @SirLouen, I am not sure if this is an error or bug

Maybe it's not a bug but an unexpected behavior that should be reviewed, but definitely needs a patch. Check my additional info,

Note: See TracTickets for help on using tickets.