WordPress.org

Make WordPress Core

Opened 5 months ago

Last modified 5 months ago

#50467 new defect (bug)

Search results not displaying all entries in Admin > Posts in certain conditions

Reported by: Sabinooo Owned by:
Milestone: Awaiting Review Priority: normal
Severity: minor Version: 5.4.2
Component: General Keywords:
Focuses: administration Cc:

Description

Limitations of my bug report

I observed that bug in a live wordpress site, not even mine, so, my apologies, I cannot experiment with it as I would have liked otherwise. No deactivating plugins, no switching to another theme.

Thus: I report the issue, explain it the best I can, but I'm leaving it at that.

Either (a) it's affecting all wordpress installs, I'm glad I could help by reporting it, or (b) for some reason, it's only the blog on which I've seen it that has it, and then I'm perfectly fine with it, it's just that, me, I cannot tell at all on my side.

Context of the bug report

A wordpress blog, latest stable, on which the admins are preparing a number of posts that will be posted while they're away on holidays, with a schedule of 2 posts a day.
Those blog posts are written in advance, their title starts with "READY TO POST ++" or "READY TO POST --" (that part will be removed in the final scheduling phase, when dates are assigned).
Those blog posts are saved as Drafts for now.

Nature of the bug:

In blog administration > Posts > All Posts, I was reported there was an issue, and indeed,

  • if I type "READY TO POST" in the upper-right search box, run the search,
  • it returns the text "12 items", and that's the right number of posts that are currently called "READY TO POST", currently in Draft state...
  • however in the listing of posts below, only 7 posts are listed, and there is no "next page" navigation to browse to a second page of posts listing

Here's a screenshot: https://imgur.com/a/qG4Awo8

I think I may have found either the origin, or a factor in the problem:
In Screen options (horizontal menu, in the admin, in the same Posts page), there is an entry called "Number of items per page:", with the value "20".
Screenshot: https://imgur.com/a/e3oDjBq

And that's wrong, it says "20", but there are only 7 posts listed in Admin > Posts > All Posts, be it the default listing, or a search.

I don't know if there's a relation, but the blog is configured to display 7 posts on the home page.

I tested something, in Admin > Posts > All Posts, I replaced that "20" by other numbers.

  • If those numbers are above the number of search results, the current bug remains, telling there are 12 results, but only showing 7.
  • If I replace "Number of items per page" by 11 or a smaller number, this time it still lists 7 posts only, but I get the missing pagination buttons, screenshot: https://imgur.com/a/fLBv7PL

Summary of what I tried: with a search, what I write on "Number of items per page" actually does NOT affect the number of displayed results, it's always 7, but depending on whether I choose a number lower, or above or equal to the expected number of results, I have, or haven't, the pagination buttons that allow to view the rest of the results posts.

*

I could partially reproduce the issue with another query.
Simply searching "ready to" returns 168 results among the posts.

... oh, damnit, I just realized. It's only a second page of results. No more. Even going into the URL of the page, trying replacing &paged=2 with something like &paged=3, did nothing, still listing the contents of &paged=2.
The only workaround is to choose to display 7 posts per page, screenshot: https://imgur.com/a/r2qwRqu

*

I forgot to list the plugins on the blog, namely: Add Browser Search, Akismet anti-spam, Antispam bee, Classic editor, Custom Smilies, Dave's wordpress live search, disable emojis (gdpr friendly), Display php version, Enhanced text widget, Inline spoilers, ManageWP- Worker, Nextscripts: social networks auto-poster, Php Code widget, Post-plugin library, Random Posts, Scheduled Post Trigger, Seemore, Shortcoder, Term Management Tools, ThreeWP Activity Monitor, User lLocker, WordPress editorial calender, Wp Editor (that one, with a community php fix to make it php7 compatible), Wp super cache, Wp-dbmanager, WP-pagenavi, Wp-polls, Wp-postratings, Wp-sweep, Wpdiscuz, WPS Hide Login, Yoast SEO, ZigWidgetClass

*

I checked the site's apache error log (I'm the host, it's on my dedi, and I help when there are issues), and I can tell there are zero events appearing in the error log while searching in the list of posts, or changing the number of display results.

*

I also helped last year, same period of time, and there wasn't that bug at that time.

*

Well, I don't see what else I could do here, hopefully it's only that blog that has that problem.
Apologies, also, that it's not a standard bug report, I'm not used to doing it at all. Good evening!

Change History (2)

#1 @Sabinooo
5 months ago

I forgot the technical details. Debian 10, Php 7.2.31-1+0~20200514.41+debian10~1.gbpe2a56b, MariaDB, Virtualmin panel.

#2 @whyisjake
5 months ago

It might be good to take this to the support forums, I think this sounds like something is hooking into WP_Query and changing the count of posts, and it might not be filtering out admin results.

Note: See TracTickets for help on using tickets.