Skip to content

Show results from page 1 when performing a new search #34

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

Merged
merged 5 commits into from
Apr 11, 2025

Conversation

xxsimoxx
Copy link
Member

@xxsimoxx xxsimoxx commented Apr 7, 2025

As spotted on the forum when a text search is performed the page is not reset to 1.
This lead to a 400 error.

This PR also adds more informations to the error message.

image

Before:

  • Select "Install CP Plugin" from "Plugin" menu
  • Navigate to page 7
  • Search for "Security"
  • "No plugins found" error is shown among "Bad Request (400)" ❌
  • Search for "Classic"
  • Notice that the current page is now 7 of 7 ❌
  • Search for "klsretmgmsrb"
  • Notice that only "No plugins found" error is shown. ✅

Testing:

  • Select "Install CP Plugin" from "Plugin" menu
  • Navigate to page 7
  • Search for "Security"
  • Notice that the current page is now 1 of 4 ✅
  • Move to page 2
  • Search for "Securit"
  • Notice that the current page is now 1 of 4 ✅
  • Search for "klsretmgmsrb"
  • Notice that only "No plugins found" error is shown. ✅

@ClassyBot
Copy link

This pull request has been mentioned on ClassicPress Forums. There might be relevant details there:

https://forums.classicpress.net/t/400-bad-request-when-searching-cp-directory-integration/6123/2

@xxsimoxx xxsimoxx marked this pull request as ready for review April 7, 2025 13:19
@xxsimoxx xxsimoxx requested a review from KTS915 April 7, 2025 13:20
@KTS915
Copy link
Member

KTS915 commented Apr 7, 2025

Using version 1.1.2, it's all working fine for me as it is.

@xxsimoxx
Copy link
Member Author

xxsimoxx commented Apr 7, 2025

@KTS915 I haven't reproduced the issue as in the forum post, but the "before" checklist showed an edge-case bug.
Can you reproduce the bug using the steps reported above?

@KTS915
Copy link
Member

KTS915 commented Apr 7, 2025

I went through the above steps, and everything worked as in the "after" but I was using the "before"! 😉

@xxsimoxx
Copy link
Member Author

xxsimoxx commented Apr 8, 2025

@KTS915 Weird! I've reproduced the issue on 3 different sites. Please take a look at my last commit to check if it makes sense.
I've changed the input type to search and it shows the search string now.

Copy link

@mattyrob mattyrob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested as per steps described, works well.

@xxsimoxx xxsimoxx merged commit 6ab53a6 into ClassicPress:main Apr 11, 2025
1 check passed
@xxsimoxx xxsimoxx deleted the notfound branch April 11, 2025 12:37
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.

4 participants