I’ve just applied the version you have provided and everything seems to work fine both on my local environment and production. Make sure to push a quick fix for this, and thanks for really quick and good response 😉
Currently the memory limit for my client’s website is set to 256MB.
I guess we both know it would not be wise to send a full database dump to anyone, so the only thing I can tell you at the moment is that the filterPages function receives $pages parameter containing exacly 875 objects.
You can easly replicate this just by duplicating the pages or writing some small script to do it in a loop 😉
875 is an exact number of published PAGES in his dashboard. Do not ask me why so many 🙂