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

Unable to set parent page #13624

Closed
mdaelemans opened this issue Jan 31, 2019 · 41 comments
Closed

Unable to set parent page #13624

mdaelemans opened this issue Jan 31, 2019 · 41 comments
Labels
[Feature] Document Settings Document settings experience [Status] Needs More Info Follow-up required in order to be actionable.

Comments

@mdaelemans
Copy link

Describe the bug
When creating a new page or editing an existing page, the Page Parent option is not always shown. After waiting for seconds, it appeared sometimes. If it appeared, the hierarchy is not correct with some existing pages that are not under the right parent in the list and missing pages below their actual parent.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Create New Page'
  2. See 'Page Attributes'
  3. No 'Page Parent' option

Expected behavior
A select field to set the parent of a page. The options in the select must be ordered well and belong to the right parent.

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Google Chrome
  • Version: 71

Additional context

  • WordPress version: 5.0.3
@swissspidy swissspidy added [Feature] Document Settings Document settings experience Needs Testing Needs further testing to be confirmed. labels Feb 7, 2019
@marjesch
Copy link

I have the same issue, exactly as you described it. The only workaround that I've found is after creating a new page, go to Pages, find the page and do a quick edit to set the parent.

@Buddierdl
Copy link

I have the same issue as well. Has there been any progress?

@designsimply
Copy link
Member

This issue may be a duplicate of #9441.

Note the comment at #9441 (comment) which mentions the parent page selector can take a very long time to load if the site has a high number of pages, such as hundreds or thousands. Because of that, it would be helpful if each person who is experiencing this issue could make a note of the total number of pages saved on the site where they are experiencing the problem. It's also helpful to list which WordPress version you are testing if possible. Thank you!

@ghost
Copy link

ghost commented May 21, 2019

In case this ever gets forgotten about (unlikely because there are hundreds of posts about this), this is major flaw in Gutenberg, and causing a major problem that didn't exist before.

I'm getting a 500 error in my console for the /wp-json/wp/v2/pages file which always appears. This seems to be blocking the parent page selector from appearing. No chance of getting this to disappear though.

I assume this is actively being investigated with the Gutenberg team?

@youknowriad
Copy link
Contributor

I wanted to update here. We tried several ways but we're unable to reproduce the issue ourselves. We'd love if someone could check in itw own installation why the api call is failing to find the root cause here.

@youknowriad youknowriad added [Status] Needs More Info Follow-up required in order to be actionable. and removed Needs Testing Needs further testing to be confirmed. labels May 21, 2019
@ghost
Copy link

ghost commented May 21, 2019

It's probably related to another issue I'm having where every time I try and update a page I get a red error banner saying 'Updating failed'.

Massive issues with Gutenberg, it should never have been released.

@ghost
Copy link

ghost commented May 21, 2019

Does this help you at all?

image

@youknowriad
Copy link
Contributor

First let me say, that that's not an issue with Gutenberg. You likely have something breaking your REST API. It could be a plugin (some security plugins disable it), a firewall, a server config...

@youknowriad
Copy link
Contributor

Also, it seems you could have PHP errors/warnings that leak into the REST API calls responses and trigger this kind of errors. Make sure to check your logs and see if there's no error there.

@ghost
Copy link

ghost commented May 21, 2019

It must be a problem with Gutenberg, because even with all plugins deactivated, granted the above errors disappear, but I then have the original 500 error with the /wp-json/wp/v2/pages URL I mentioned earlier.

This is with a pure WP instance running, with no plugins. It's a bit of a coincidence if several others were having the same issue, if it's down to a firewall or server configuration.

The issue here lies within Gutenberg, so pleas ejust because you're unable to diagnose and fix it, don't just claim it's not an issue with Gutenberg.

@youknowriad
Copy link
Contributor

I'm sorry you're having issues, we can't disagnose and fix an issue we can't reproduce, I hope you understand that. We had several similar complaints about this kind of issues and it always come down to the same root issues I explained above.

@ghost
Copy link

ghost commented May 21, 2019

Tell you what, I'm going to stick with the Classic Editor for all the websites I run, and get them all back to a stable, working state whilst the Guternberg team are able to fix the broken product they have forced onto us.

I'm not the only one to think it's an incredibly bad product / feature, and that it should be removed.

@Buddierdl
Copy link

Just wanted to comment that I resolved the issue on my install. It turned out to be a bad plugin that messed up the REST API JSON.

@marjesch
Copy link

Would you be willing to share which plugin it was? I've duplicated my site in a sandbox and disabled all plugins and still have a problem.

@Buddierdl
Copy link

It was WP Gallery Custom Links.

@marjesch
Copy link

Hmmmmm. I just imported my database of my development site (1057 pages and 391 posts) into a fresh install of Wordpress. No plugins installed. When I edit a page it takes about ten seconds for Parent Page to show up. When it does it's not in any logical order. At least I'm not seeing the same page listed multiple times, but they're definitely not in alphabetical order like they are when I do a quick edit in Pages. In my development site with a full set of plugins I'm seeing multiple listings of the same page under Parent pages, so it must be a plugin causing that. Now to figure out which plugin is causing pages to be listed multiple times. But it still doesn't resolve the issue that even with no plugins Pages aren't listed in an reasonable order.

@gwwar
Copy link
Contributor

gwwar commented May 29, 2019

I wonder if we can add an enhancement here, Gutenberg basically tries to fetch all pages before displaying the Parent Page dropdown. When a site has many pages this can lead to long delays before UI appears, and should any of the requests error, I believe the UI fails to load.

One enhancement would be to display a search component when the number of pages is > X. There's no reason that the client needs to fetch everything when there are thousands of pages.

@ghost
Copy link

ghost commented May 29, 2019 via email

@youknowriad
Copy link
Contributor

@gwwar yes, this is something that we want to do (See #7385) @adamsilverstein has been working on it at some point but he might need some support now. The main issue we had was the difficulty to build an a11y autocomplete component.

@adamsilverstein
Copy link
Member

I would welcome some support, especially adding some e2e tests for the existing PR functionality.

@bobbingwide
Copy link
Contributor

We'd love if someone could check in itw own installation why the api call is failing to find the root cause here.

See #13618

@iandunn
Copy link
Member

iandunn commented Jun 6, 2019

Possibly related:

#12795
#13618
#15115

@bschlagel
Copy link

I'm also experiencing this issue. "Parent Page" appears in the meta box after a few seconds, but just displays '(no parent)' as the only item in the dropdown, the actual pages don't load.

This is on a site with ~2,700 posts and ~38,000 rows in the wp_posts table. Just an extra data point here.

Sounds like an underlying issue has been identified in #13618 and #9441 — and the awesome solution for an autocomplete selector proposed in #7385 could solve this problem as well. (Looks like fantastic work from @adamsilverstein !)

As far as I can tell, #7385 would be an enormous improvement for any selectors with a large number of potential results; I hope this can be merged and implemented for the Parent Page selector as well.

Even when the current Parent Page selector is working correctly (I'm able to load it in 'quick edit') a giant dropdown list quickly becomes untenable for any site with more than ~ a few dozen pages. To that end I agree with this comment — using this selector only when you'd have say > 100 results seems to make a lot of sense both for usability and the current performance issues with large numbers of results.

The main issue that comes to mind as far as porting that post author selector for use in the parent page selector would be disambiguating post titles — since multiple pages can have identical titles the results should probably show the page id and/or page parent title to disambiguate. Ideally this would work with both title search, or entering the page ID directly.

Could be worth looking to the ACF plugin as an example; they seem to have a pretty performant autocomplete page selector (see the Page Link and Post Object custom field types).

@GemmyOrvayne
Copy link

This fixed it for me:
Settings --> Reading --> Your homepage displays: Static Page --> Select the page you want as the homepage.
Now parent page settings are visible on all pages.

@tigredanky
Copy link

Having the same issue for me. @GemmyOrvayne's solution didn't help as I already had the front page set (no blog on this page).

@marjesch
Copy link

I still have the same issue. Over 1,500 pages and over 500 posts. Static home page defined.

@LuckyTime154
Copy link

Also for me, just one of several issues with Gutenberg. Another (most likely related) issue is that there are no internal link suggestions when I try to make a link.

@designsimply
Copy link
Member

@LuckyTime154 link suggestions are being worked on at #17557, consider following along there.

@adamsilverstein
Copy link
Member

@LuckyTime154 can you give some more details about your install: how many pages/posts do you have? Does the link suggestion work if you type a few letters from a post title? Finally, do you see any errors in your browser's debug console?

@LuckyTime154
Copy link

@adamsilverstein 500 pages, 100 posts, 150 custom post type pages. Link suggestion does not work at all, also not after typing. I do see the loading circle, but no suggestions. I disabled all plugins.

I believe the JSON errors in the console are pointing to the issue
code: "invalid_json"
message: "The response is not a valid JSON response."
proto: Object

Once at /post.php?post=4572&action=edit
Another at /wp-includes/js/dist/editor.min.js?ver=9.2.6

Another error (maybe unrelated):
Uncaught (in promise) TypeError: Failed to fetch
at /wp-includes/js/dist/data.min.js?ver=4.4.0

@adamsilverstein
Copy link
Member

Hey @LuckyTime154 can you confirm your WordPress version and whether you are using the GB plugin?

The console errors are suspicious. This may be related to code in your theme - do you see these errors on page load, or only when trying to do a link search? I feel like the link suggestion issue may be worth a separate issue as this ticket is focused n parent page selection.

Regarding pages: if you leave the page open for a while, does the parent page selector appear eventually?

@LuckyTime154
Copy link

@adamsilverstein I tested this with all plugins deactivated and theme 2019 on my staging site. Errors are on page load. Parent page selector does not appear eventually.

I guess it's something in my code that lingers after I deactivate plugins and switch themes. It's not a big issue for me, I can use the classic editor without problems.

Just thought I'd let you guys know that it is an issue for some, but probably very difficult for you to figure out what it could possibly be.

@adamsilverstein
Copy link
Member

Thanks for taking the time to do the testing and provide details @LuckyTime154 - it does feel like you have some other issues going on that might be causing this.

@LuckyTime154
Copy link

LuckyTime154 commented Oct 31, 2019

@adamsilverstein I fixed it, the issue was mixed content. Found solution here.

Deleting htaccess file and re-saving permalinks fixed it. edit: actually, just adding RewriteCond %{REQUEST_URI} !^/wp-json to htaccess works even better.

The link suggest dropdown box was a similar issue of mixed content, but with a different origin. It does not work on my staging server, but it does work on my live site due to some SSL issues with the subdomain.

@karmatosed
Copy link
Member

I think this issue is either fixed for some of the issues were found for others? I am for now going to close this, but can always reopen.

@dcooney
Copy link

dcooney commented Jun 4, 2020

I'm getting this issue on an install at Pantheon. The API call to /wp-json/wp/v2/pages is returning 504 and the Parent drop menu never populates.

image

The same site instance populates on my local build so it may be host specific.

Note, the REST API is enabled and working for other instances throughout the site.

@bobbingwide
Copy link
Contributor

I think this issue is either fixed for some of the issues were found for others? I am for now going to close this, but can always reopen.

No, it's not fixed. The underlying problem ( WordPress doing far too much work to satisfy a simple request ) is still there. Quite a few issues have been closed as duplicates of #13618. Some work was attempted to support the '_fields' requests in Jan 2020 but abandoned in May. My recent attempt to fix the issue has stalled because - even though it appears to work - I've been told that there could be major issues with subsequent requests getting incomplete cached data.

@davidamarek
Copy link

I'm still getting this too - "Uncaught (in promise) SyntaxError: Unexpected end of JSON input" in the console.

@rogercoathup
Copy link

[Error] Failed to load resource: the server responded with a status of 500 (Internal Server Error) (pages, line 0)
https://d******.com/wp-json/wp/v2/pages?per_page=100&exclude=419426&parent_exclude=419426&orderby=menu_order&order=asc&context=edit&_locale=user

@bobbingwide
Copy link
Contributor

https://d******.com/wp-json/wp/v2/pages?per_page=100&exclude=419426&parent_exclude=419426&orderby=menu_order&order=asc&context=edit&_locale=user

The fix for #13618 should be in 8.9.x. The query should only be requesting 3 fields. From where is your request emanating @rogercoathup ?

@SolespireMarcus
Copy link

I have the same issue, exactly as you described it. The only workaround that I've found is after creating a new page, go to Pages, find the page and do a quick edit to set the parent.

This problem started occurring for me today, for no reason, but your workaround is a solution I can work with for now. It's actually more stable with the dropdown there, versus the flakey selection area that is under Page Attributes on the editor screen.

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 [Status] Needs More Info Follow-up required in order to be actionable.
Projects
None yet
Development

No branches or pull requests