-
AuthorPosts
-
June 5, 2019 at 7:14 pm #1107722
I just updated my enfold theme, using the ‘update theme from zip file’ plugin because of the envato API issue that the update url didn’t work.
Anyway, everything seems fine apart from when i click a page to edit it, I receive the following fatal error:
Fatal error: Uncaught Error: Call to undefined function gutenberg_can_edit_post_type() in /homepages/clickandbuilds/DevSite/wp-content/themes/enfold/config-gutenberg/class-avia-gutenberg.php:529 Stack trace: #0 /homepages/clickandbuilds/DevSite/wp-content/themes/enfold/config-gutenberg/class-avia-gutenberg.php(1103): Avia_Gutenberg->can_use_block_editor('post') #1 /homepages/htdocs/clickandbuilds/DevSite/wp-content/themes/enfold/config-gutenberg/class-avia-gutenberg.php(1119): Avia_Gutenberg->needs_block_editor_extra_data() #2 /homepages/htdocs/clickandbuilds/DevSite/wp-includes/class-wp-hook.php(286): Avia_Gutenberg->handler_avf_builder_boxes(Array) #3 /homepages/htdocs/clickandbuilds/DevSite/wp-includes/plugin.php(208): WP_Hook->apply_filters(Array, Array) #4 /homepages/htdocs/clickandbuilds/DevSite/wp-content/themes/enfold-child/shortcodes/meta.php(22): apply_filters('avf_builder_box...', Array) #5 /homepages/ in /homepages/htdocs/clickandbuilds/DevSite/wp-content/themes/enfold/config-gutenberg/class-avia-gutenberg.php on line 529
Please note, I am running PHP 7.2 and I have tried deactivating all plugins, which didn’t make a difference. I have also selected ‘use WP classic editor’ in the theme options.
I can still edit the page by viewing it first then clicking the ‘edit post’ link in the wordpress admin header bar, but this is not exactly a suitable solution for a client, so was hoping someone can tell me how to edit the class-avia-gutenberg.php file to avoid the error? The only difference in the url’s when clicking a page or post directly from the backend compared to the wordpress admin header bar in the front end, is the extra ‘&classic-editor=1’ on the end.
June 6, 2019 at 6:09 am #1107817Hey Birdster,
Sorry for the problem. Please send us a temporary WordPress admin login and login URL so that we can have a closer look. You can post the details in the Private Content section of your reply.
Best regards,
RikardJune 6, 2019 at 10:12 am #1107867Thanks Rikard,
I have sent the login details privately, and to re-create the error simply click on any page or post type within the wordpress back end.
June 10, 2019 at 12:41 pm #1108803Hi,
Thanks for the update.
The following modification in this thread should help. (see private field)
// https://kriesi.at/support/topic/gutenberg-editor/#post-1086464
Make sure that the site is running on version 4.5.7
Best regards,
IsmaelJune 17, 2019 at 4:47 pm #1111046Hi Ismael,
I replaced the original class-avia-gutenberg.php file but the error still occurs. The original thread you linked me to did mentioned the error warning was line 329, however my error says line 529 – so it may be a different error?
Any other ideas?
June 19, 2019 at 11:06 am #1111564Hi,
What WP version are you using?
This function gutenberg_can_edit_post_type is called because function use_block_editor_for_post_type is missing – this is only on older WP 5 version which are using the “gutenberg plugin”. This has been cbanged later.
Try to update WP to 5.2.2 and deactivate gutenberg plugin (if you have activated it). You can also deactivate the classic editor plugin as this should be properly handled by Enfold theme option.
Best regards,
GünterJune 19, 2019 at 11:47 am #1111576Hi Gunter,
I am using the latest 5.2.2 wordpress and have disabled all plugins. As for the gutenberg plugin, i did attempt to disable this by adding some code to the functions.php file – but it didn’t solve the problem, so have since removed the code. If you have a better way to disable he gutenberg plugin, then please let me know and I’ll give it a go…
June 21, 2019 at 8:57 am #1112229Hi,
You can actually disable the block or Gutenberg editor from the Enfold > Theme Options panel. Just look for the “Select your Editor” settings. Or install the “Classic Editor” plugin.
Thanks for the update.
Best regards,
IsmaelJune 24, 2019 at 12:00 pm #1112898Ismael,
I had already selected the classic editor in the theme options. I also previously used the classic editor plugin, but thought the whole point of updating enfold and having this editor selection built into the theme was that I could remove the additional plugin.
So as it stands, regardless of which editor is selected in the enfold theme options, the original ‘line 529’ error appears because the url directed to is:
http://sitename/wp-admin/post.php?post=1234&action=editHowever, if the classic editor is selected in the theme options and I view the page first then use the ‘edit page’ link within the wordpress admin header bar, then the advanced layout editor does load, as the url directed to is:
http://sitename/wp-admin/post.php?post=1234&action=edit&classic-editor=1However, my Client is not happy with this, so I need to understand what the ‘line 529’ error is? To be honest, I could just revert to an older version of enfold and re activate the classic editor plugin, but that seems a bit backwards to me.
If I use the classic editor plugin as well as selecting the classic editor in the theme options, then the correct url is used when clicking a page or post directly from the dashboard, but should the block editor ever be needed in the future, the original error would prevent it from ever being an option.
Any other ideas why line 529 could be causing me this conflict? Or do I revert to the older version of enfold?
June 26, 2019 at 2:53 am #1113426Hi,
The soon to be deprecated “gutenberg_can_edit_post_type” function should be replaced with “use_block_editor_for_post_type” function if it exists, so it’s quite odd that the error occurs even on the latest version of WP. Please upgrade the theme to version 4.5.7, remove the Classic Editor plugin and switch to the old editor via the Enfold > Theme Options panel.
This is where the error lies ( line 529 of class-avia/config-gutenberg/class-avia-gutenberg.php file )
if( $post instanceof WP_Post ) { $post_type = $post->post_type; $use_block = function_exists( 'use_block_editor_for_post' ) ? use_block_editor_for_post( $post ) : gutenberg_can_edit_post( $post ); } else if( is_string( $post ) ) { $post_type = $post; $use_block = function_exists( 'use_block_editor_for_post_type' ) ? use_block_editor_for_post_type( $post_type ) : gutenberg_can_edit_post_type( $post_type ); }
Related thread: https://github.com/WordPress/gutenberg/pull/14096
Best regards,
IsmaelNovember 15, 2019 at 3:30 am #1157043I got the same error.
Fatal error: Uncaught Error: Call to undefined function gutenberg_can_edit_post_type() in /public/wp-content/themes/enfold/config-gutenberg/class-avia-gutenberg.php:525I got an email notifying me about the page where I got the error:
https://www.xxxxx.com.tw/wp-admin/options-general.php?page=simple_history_settings_menu_slug&selected-tab=export),My WordPress vision is 5.2.4, Enfold vision is 4.6.3.1. and PHP is 7.3
I do not use other Editor plugin and choose the classic editor via the Enfold > Theme Options pane.November 16, 2019 at 4:04 am #1157383Hi debra15,
Please open a new thread and include WordPress admin login details in private so that we can have a closer look at your site.
Best regards,
Rikard -
AuthorPosts
- You must be logged in to reply to this topic.