On this site a fatal error is triggered when editing existing or adding new posts.
When Views and Types are active the error is:
[10-Jun-2021 08:31:56 UTC] PHP Fatal error: Uncaught Error: Maximum function nesting level of '256' reached, aborting! in /wp-includes/class-wp-object-cache.php:281
Stack trace:
#0 /wp-includes/cache.php(125): WP_Object_Cache->get(1551, 'posts', false, NULL)
#1 /wp-includes/class-wp-post.php(239): wp_cache_get(1551, 'posts')
#2 /wp-includes/post.php(782): WP_Post::get_instance(1551)
#3 /wp-content/plugins/wp-views/vendor/toolset/dynamic-sources/server/Integrations/Views.php(100): get_post(1551)
#4 /wp-includes/class-wp-hook.php(292): Toolset\DynamicSources\Integrations\Views->adjus in /wp-includes/class-wp-object-cache.php on line 281
This then produces a following JS error in the Post Edit Screen console:
Failed to load resource: the server responded with a status of 500 (Internal Server Error) on /wp-json/wp/v2/blocks?per_page=100&context=edit&_locale=user
Unhandled Promise Rejection: [object Response] in /wp-includes/js/dist/vendor/wp-polyfill.min.js?ver=7.4.4
When Views is deactivated the error is:
[10-Jun-2021 08:37:14 UTC] PHP Fatal error: Uncaught Error: Maximum function nesting level of '256' reached, aborting! in /wp-includes/meta.php:530
Stack trace:
#0 /wp-includes/meta.php(530): is_numeric(1551)
#1 /wp-includes/meta.php(506): get_metadata_raw('post', 1551, 'wpcf-pattern-ph...', false)
#2 /wp-includes/post.php(2226): get_metadata('post', 1551, 'wpcf-pattern-ph...', false)
#3 /wp-content/plugins/types/application/models/field/gateway/wordpress-post.php(34): get_post_meta(1551, 'wpcf-pattern-ph...')
#4 /wp-content/plugins/types/application/models/field/mapper/abstract.ph in /wp-includes/meta.php on line 530
Here is an AIO of the site stripped down to only Views and Types, using default theme, with re-installed WordPress, no Custom Code.
You just need to add a new post, then wait for the error to pop into the console and observe the error log meanwhile.
<removed by author>
Note, on the live server, the error happens again in another location and is a Memory Exhaustion, however, the same JS error will be shown and I believe it doesn't really matter what PHP error happens, something is overflowing memory and it is due to both or just Types/Views.
As soon the Types plugin is disabled, the issue is resolved.
While I cannot replicate this issue on a fresh install, I clearly can replicate it on this stripped down website, and it is resolved as soon we disable Toolset, which leaves me no choice but to ask here for a deeper look and eventual resolution.
I am relatively sure this has to do with the amount of Fields/Posts used, thus why I can't replicate it on a clean install...
Note that on my local test site of which the above AIO is a copy of, I already deleted all Types Fields and Relationships as well (after talking the AIO backup I sent you) and the error persists, thus, this is now almost a clean site on my local and the problem did not go away.
I am experiencing the issue both on apache and nginx of which one has 5GB ram, so this is not a server issue either.
The only what finally resolved the issue was to delete ALL posts from the _posts table, but that is not a solution I can adapt in the live install
Given that, I suspect some post somewhere has a ShortCode or Toolset Block in it that somehow manages to exhaust all memory
But why this is even affecting things when I edit or add a new post, and/or why this has to be failing in a Fatal error that is resolved as soon I disable Types, is not clear to me.
I hope you can help with this...
Thanks