Parent Pages List JS Error
-
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=2It 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.
The topic ‘Parent Pages List JS Error’ is closed to new replies.