-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Parent page duplicated on huge use with menu_order in dropdown #12795
Copy link
Copy link
Closed
Labels
[Feature] Document SettingsDocument settings experienceDocument settings experience[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Description
Describe the bug
Context: on a website with a lot of pages on 0/1/2/3 or 4 sublevels depending on the 1st level page, using menu order on first level but also sometimes on sublevel, the dropdown duplicate some pages and doesn't show all.
Debugging:
- i duplicated the selector and changed the query to sort by ID, it's working fine. So to make it work change orderby menu_order to orderby id
- the bug is in the function "buildTermsTree" here
export function buildTermsTree( flatTerms ) { - after logging a bit it seems to be in the use of groupBy (from lodash) here:
const termsByParent = groupBy( flatTerms, 'parent' );
In my tests, the param flatTerms looks fine in both cases, but termsByParent is different
To Reproduce
Steps to reproduce the behavior:
- Create 300 pages on different sub levels
- Set menu order on some of them
- Edit a page and try to choose en parent page
- See what is the result
Expected behavior
No duplicate content
Screenshots
Additional context
- This appears in the last version of Gutenberg (4.7.0 RC and 4.6.1 on Wordpress 4.9.8 and on Wordpress 5.0)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
[Feature] Document SettingsDocument settings experienceDocument settings experience[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Type
Fields
Give feedbackNo fields configured for issues without a type.
