humanmade / authorship

A modern approach to author attribution in WordPress.
GNU General Public License v3.0
66 stars 7 forks source link

Fatal error in customizer #84

Closed pdewouters closed 2 years ago

pdewouters commented 3 years ago

Using WordPress 5.8 To reproduce, click the Customize menu item under appearance, this should trigger the fatal error: Fatal error: Uncaught Error: Argument 1 passed to Authorship\is_post_type_supported() must be of the type string, null given, called in /chassis/content/plugins-mu/vendor/authorship/inc/namespace.php on line 542 in /chassis/content/plugins-mu/vendor/authorship/inc/namespace.php on line 81

Screenshot 2021-08-03 at 11 39 23
johnbillion commented 3 years ago

Thanks for the report. I guess this is because since 5.8 the block editor can be used without the context of a post, which means the enqueue_block_editor_assets action can fire when there's no global $post.

enqueue_assets() needs to be updated to account for this.

rmccue commented 2 years ago

Hit this as well in Altis v9 beta.

rmccue commented 2 years ago

PR'd at https://github.com/humanmade/authorship/pull/88