• Resolved Jon Harvey

    (@webdeveloperjon)


    Since upgrading to the gutenberg editor we noticed that the parent page selector had disappeared from the page editing screen (under page attributes). It turns out a JS error is occuring.

    We think that it is struggling to cope as the function appears to be repeatedly making calls to:

    https://ptes.org/wp-json/wp/v2/pages
    The parameters happen to be:

    per_page=100
    exclude[0]=1426
    parent_exclude[0]=1426
    orderby=menu_order
    order=asc
    context=edit
    _locale=user
    page=2

    It repeatedly calls the pages API through to page 7 whereupon the JS wp-polyfill.min.js crashes with ‘Unhandled promise rejection Error: “[object Response]’. The actual response from the server is a 502 error, meaning, it’s given up or blocked the request.

    We wondered if it could be crashing due to the volume of JSON being returned as it appears to be returning the *full* content for each page it returns in the listing. Our situation this means it’s loading the full content of at least 600 pages before dying (there are 716 pages based on the count on the pages screen).

    For this particular operation (displaying the parent pages for a dropdown), isn’t there a way of getting it to just retrieve the fields it needs? i.d. ID and Page title? It would be far more effient and less server intensive. Each of those JSON requests is returning ~1MB of data.

    Thank you

    NB: We’re aware the parent page dropdown is available on the quick edit screen and works as expected. We’re just trying to find – or encourage the developers to take on board – a solution to this problem on the edit screen.

Viewing 1 replies (of 1 total)
  • Thread Starter Jon Harvey

    (@webdeveloperjon)

    Just by way of an update, this issue went away for us when WP was updated to 5.1.1, so it’s possible stability of either the backend editor, or the API was improved, or it may have been a plugin issue that an update resolved.

    It still takes a very long time to appear whilst it loads all the parent pages (700+ pages, 30+ seconds), because it is loading the full data for each, as described above. We’ve made a suggestion on the Github page that this be improved by making requests to the API that only return the required fields. However, this may or may not be possible as the API currently stands.

Viewing 1 replies (of 1 total)

The topic ‘Parent Pages List JS Error’ is closed to new replies.