WordPress.org

Making WordPress.org

Opened 2 years ago

Closed 13 months ago

#3019 closed defect (fixed)

Searching dynamic hooks returns no results

Reported by: ocean90 Owned by: coffee2code
Milestone: Priority: normal
Component: Developer Hub Keywords: needs-patch
Cc:

Description

I entered rest_{ in the search field and got an autocomplete for rest_{$this->post_type}_query. But the search returns no results for this query.

Related: #686, #557

Change History (6)

#1 @pbiron
2 years ago

I'm seeing this too. However, it isn't all searches for dynamic hooks.

Doing a few "random" searches for dynamic hooks suggests that the problem only surfaces when the search contains $object->.

For instance:

  • {$old_status}_to_{$new_status} works
  • term_{$field} works
  • manage_{$screen->id}_columns does NOT work
  • rest_{$this->post_type}_query does NOT work

The odd thing is that it works correctly on my local clone of the Code Reference (I did an SVN update on wporg-developer this morning, so my local has the latest code).

Hope the above helps someone track down the problem.

#2 follow-up: @ocean90
2 years ago

@pbiron Nice research, it's only about the >. A search for rest_{$this->post_type}_query does work.

#3 in reply to: ↑ 2 @pbiron
2 years ago

Replying to ocean90:

@pbiron Nice research, it's only about the >. A search for rest_{$this->post_type}_query does work.

That's really odd, because that search does not work on my local clone...but yes, it does work on the real code reference :-(

#4 @keesiemeijer
2 years ago

My results are the same as @pbiron.

On my local machine the search for rest_{$this->post_type}_query works and is redirected to /reference/hooks/rest_this-post_type_query/
And the search for rest_{$this->post_type}_query does not work.

The only way I can replicate this issue locally is if I rename the post title to rest_{$this->post_type}_query in the database.

This ticket was mentioned in Slack in #meta-devhub by drew. View the logs.


13 months ago

#6 @coffee2code
13 months ago

  • Owner set to coffee2code
  • Resolution set to fixed
  • Status changed from new to closed

In 7827:

Developer: Rerun empty searches where the search term contains characters that can be converted to HTML entities, but with such characters converted.

Fixes #3019.

Note: See TracTickets for help on using tickets.