Skip to content
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

Parent page duplicated on huge use with menu_order in dropdown #12795

Open
kent1D opened this issue Dec 11, 2018 · 8 comments
Open

Parent page duplicated on huge use with menu_order in dropdown #12795

kent1D opened this issue Dec 11, 2018 · 8 comments
Labels
[Feature] Document Settings Document settings experience [Type] Bug An existing feature does not function as intended

Comments

@kent1D
Copy link

kent1D commented Dec 11, 2018

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:

  1. 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
  2. the bug is in the function "buildTermsTree" here
    export function buildTermsTree( flatTerms ) {
  3. 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:

  1. Create 300 pages on different sub levels
  2. Set menu order on some of them
  3. Edit a page and try to choose en parent page
  4. See what is the result

Expected behavior
No duplicate content

Screenshots

capture d ecran 2018-12-11 a 13 23 18

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)
@kent1D
Copy link
Author

kent1D commented Dec 11, 2018

The best way to solve it may be to:

  • get the posts ordered by id
  • keep the menu_order in the datas here like adding order: item.menu_order,
  • use orderBy(..., 'order') from lodash to sort by menu_order then

@swissspidy swissspidy added [Type] Bug An existing feature does not function as intended [Feature] Document Settings Document settings experience Needs Testing Needs further testing to be confirmed. labels Dec 11, 2018
@MarkPraschan
Copy link

I am seeing this same behavior (duplicates and missing pages) with WordPress 5.0.3. We have over 500 pages. I'm not sure if order has been set on any. The parent page dropdown from within Quick Edit still works correctly.

@lakellie
Copy link

lakellie commented Feb 6, 2019

This issue was reported by a WordPress.com user with an Atomic site.

@marjesch
Copy link

I have the same issue too. I have a large site with over 500 pages and my issue is exactly as described above.

@LuckyTime154
Copy link

LuckyTime154 commented Nov 2, 2019

I have the same issue. 500+ pages. It's been a year...Is WP planning to fix this or shall we give up on Gutenberg (again)?

@talldan
Copy link
Contributor

talldan commented Apr 20, 2020

Possibly related: #21563

@bobbingwide
Copy link
Contributor

I also reported this problem in #13618 (comment) and reproduced it today with Gutenberg 8.4.

See also TRAC 46294 https://core.trac.wordpress.org/ticket/46294

bobbingwide added a commit to bobbingwide/gutenberg that referenced this issue Jul 2, 2020
bobbingwide added a commit to bobbingwide/gutenberg that referenced this issue Jul 2, 2020
bobbingwide added a commit to bobbingwide/gutenberg that referenced this issue Jul 2, 2020
bobbingwide added a commit to bobbingwide/gutenberg that referenced this issue Jul 2, 2020
bobbingwide added a commit to bobbingwide/gutenberg that referenced this issue Jul 2, 2020
bobbingwide added a commit to bobbingwide/gutenberg that referenced this issue Jul 2, 2020
bobbingwide added a commit to bobbingwide/gutenberg that referenced this issue Jul 2, 2020
@DimitriDV
Copy link

Schermafbeelding 2020-10-02 om 09 52 37

I have the same issue!

@skorasaurus skorasaurus removed the Needs Testing Needs further testing to be confirmed. label Feb 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Document Settings Document settings experience [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

10 participants