• I’ve been getting our site ready for Gutenberg and noticed that the Parent Page drop down box under Page Attributes fails to load in the editor.

    If I use the inspector and go to the network tab I noticed that there is a json error when WordPress is trying to populate the Parent Page drop down box. WordPress initiates this process via the following file:

    /wp-includes/js/dist/api-fetch.min.js

    The file loads 100 pages at a time and fails on page 16.

    /wp-json/wp/v2/pages?per_page=100&exclude%5B0%5D=33571&parent_exclude%5B0%5D=33571&orderby=menu_order&order=asc&context=edit&_locale=user&page=16

    Our website has a lot of pages (3,148) so populating this drop down box takes time.

    I was able to trace the error back to the Photonic plugin. When disabled the theme and all plugins the Parent Page loads in the editor. I then turned the theme back on and plugins one by one to test where the issue was. Photonic plugin causes this process in the new Gutenberg editor to fail if there are a lot of pages.

    Is there a way I can stop your plugin from loading anything in the editor? I don’t use the wizard in the editor, I merely hand code a shortcode in my page if I want to add a gallery. If I can keep the plugin from loading in the editor I can still use your excellent plugin, but have the very important Parent Page selector functioning.

    Thank you for any advice you can give me!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Sayontan Sinha

    (@sayontan)

    Can you tell me what the JSON error is? If it is something generic like “Internal Server Error 500” or something similar, can you check to see if there are any errors in your PHP error log on your server?

    Thread Starter fpmtinc

    (@fpmtinc)

    It is error 500 on page 16 of the following.

    /wp-json/wp/v2/pages?per_page=100&exclude%5B0%5D=33571&parent_exclude%5B0%5D=33571&orderby=menu_order&order=asc&context=edit&_locale=user&page=16

    I checked the server logs and there are no PHP errors in the log.

    I am not a programmer, but I don’t think this has to do with PHP. Gutenberg uses REST API which is JSON (javascript). The JSON call that fails is the URL above. When I deactivate your plugin there is no JSON error and the Parent Page drop down loads.

    Plugin Author Sayontan Sinha

    (@sayontan)

    I am not a programmer, but I don’t think this has to do with PHP

    Actually a “500” error can only be triggered by the server (i.e., by PHP), hence it is called an “Internal server error”. Basically, the request is getting forwarded to a PHP method, which is failing due to some reason and is telling the REST API that there was an error.

    If you were able to find the error text that would really help, otherwise this is a shot in the dark, as I am unable to come up with any ideas. Basically Photonic does nothing to interfere with the functionality to list pages, which is why this is puzzling, and I cannot replicate the problem. Of course, I don’t have even 100 pages on my site, but I don’t think that has any significance here.

    Let’s start with a few simple steps:

    1. When you go to Pages → All Pages in your Admin dashboard, are you able to go to Page 16 and see the content there without issues? Is there anything special on that page? Like something with a Photonic gallery?
    2. In the Pages → All Pages screen, are you able to do a “Quick Edit” for your posts and change the parent page there without actually opening the page?
    3. If the above works, is it an acceptable alternative? Basically the Quick Edit functionality is considerably lighter than Gutenberg and you will not have to load all the bloat that comes with Gutenberg.
    4. If you go to Photonic → Settings → Generic Options → Photo Template, do you see anything populated in the dropdown for “Dedicated page to use for gallery display”?
    Plugin Author Sayontan Sinha

    (@sayontan)

    Hi,
    Following up on this. Did the suggestions above help?

    Thread Starter fpmtinc

    (@fpmtinc)

    Hello,

    Thank you for following up, and my apologies for taking awhile to get back to you. I’ve been busy with other tasks. Here are my answers to your questions:

    1. I can see all the pages on page 16, it loads fine. There is a gallery on that page, but there are pages before 16 that also have galleries.
    2. I can do quick edit and change the parent there.
    3. This isn’t really a good option for us since we have over 3,000 pages. Our editors would struggle with the time it takes to find their pages.
    4. When I go to this page the dedicated page drop down is blank, but if I click on it there is a list of roughly a couple of hundred of our pages.

    Thanks again for your time. In the meantime I’ve been looking into plugins that would allow me to block your plugin from loading in the editor, or a way to do this programmatically.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Gutenberg Issue: Parent Selector Not Working’ is closed to new replies.