#55609 closed defect (bug) (duplicate)
Drop-down list of pages (to select the parent page in post editor) incomplete or empty when the number of pages> 100
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 5.9.3 |
| Component: | Editor | Keywords: | needs-patch |
| Focuses: | Cc: |
Description
The problem is in the algorithm for creating a list of pages.
Location: post editor - wp/wp-admin/post.php?post=1234&action=edit
Conditions:
- number of posts (with "type=page and status=publish") > 100
- page with parent=0 and some number of children does not meet "ORDER BY wp_posts.menu_order ASC LIMIT 0, 100"
Even if all of it Children have been returned by query, none of them will be in the list.
Cause:
wp-includes/js/dist/editor.js
6004: function PageAttributesParent()
6076:
if (!fieldValue) {
tree = buildTermsTree(tree);
}
----------------------
5904: function buildTermsTree(flatTerms)
5927: return fillWithChildren(termsByParent['0'] || []);
Solution:
It is necessary to build a page query differently.
For example, choose pages that have parent=0
Then pages that have parent among first group of pages.
Change History (2)
Note: See
TracTickets for help on using
tickets.
Hi there, welcome back to WordPress Trac!
Thanks for the report, we're already tracking this issue in #52626.