Calypsoify: Recent updates break Calypsoify
@mdawaffe The recent #11460 merge breaks Calypsoify, giving an error PHP Fatal error: Uncaught Error: Call to undefined function use_block_editor_for_post_type() in /var/www/html/wp-content/plugins/jetpack/modules/calypsoify/class.jetpack-calypsoify.php:335. It looks like this gets triggered by AJAX calls, such as saving drafts. I noticed it by clicking the Preview button.
Steps to reproduce the issue
- Go to
/wp-admin/post-new.php?calypsoify=1. - Make an update, and click on
Preview. - See error both in console and logged server-side.
I thought I could just wrap the instantiation in a ! DOING_AJAX check, but then Calypsoify doesn't seem to load at all (you can tell if you're in the calypsofied version of Gutenberg by the hot pink Publish button; if it's blue, add the ?calypsoify=1 query param to set it).
Can you see a better fix?
cc/ @obenland in case you work at all on #11354 .
Nice catch! It looks like this code never quite worked correctly when we started calling use_block_editor_for_post_type() (even conditionally).
Calypsoify runs before any admin includes are required, so that function never exists for Calypsoify even with the latest versions of WordPress.
I'll look into a fix.
Nice catch! It looks like this code never quite worked correctly when we started calling use_block_editor_for_post_type() (even conditionally).
So broken we couldn't tell it was broken – until we broke it (software, amirite?) 🙃 . Thanks again for the fix!