jetpack icon indicating copy to clipboard operation
jetpack copied to clipboard

Calypsoify: Recent updates break Calypsoify

Open kwight opened this issue 7 years ago • 3 comments

@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

  1. Go to /wp-admin/post-new.php?calypsoify=1.
  2. Make an update, and click on Preview.
  3. 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?

kwight avatar Mar 22 '19 00:03 kwight

cc/ @obenland in case you work at all on #11354 .

kwight avatar Mar 22 '19 00:03 kwight

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.

mdawaffe avatar Mar 22 '19 00:03 mdawaffe

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!

kwight avatar Mar 22 '19 17:03 kwight