Tagged: enfold theme
-
AuthorPosts
-
October 26, 2022 at 11:47 pm #1370389
After updating this site: https://www.dialhope.org/, we are now seeing this error on our Icegram plugin:
Argument 1 passed to Avia_Gutenberg::handler_display_post_states() must be of the type array, bool given, called in /home3/brighth7/public_html/dialhope/wp-includes/class-wp-hook.php on line 307 and defined in /home3/brighth7/public_html/dialhope/wp-content/themes/enfold/config-gutenberg/class-avia-gutenberg.php:693 Stack trace: #0 /home3/brighth7/public_html/dialhope/wp-includes/class-wp-hook.php(307): Avia_Gutenberg->handler_display_post_states(false, Object(WP_Post)) #1 /home3/brighth7/public_html/dialhope/wp-includes/plugin.php(191): WP_Hook->apply_filters(false, Array) #2 /home3/brighth7/public_html/dialhope/wp-admin/includes/template.php(2249): apply_filters(‘display_post_st…’, Array, Object(WP_Post)) #3 /home3/brighth7/public_html/dialhope/wp-admin/includes/template.php(2150): get_post_states(Object(WP_Post)) #4 /home3/brighth7/public_html/dialhope/wp-admin/includes/class-wp-posts-list-table.php(1107): _post_states(Object(WP_Post)) #5 /home3/brighth7/public_html/dialhope/wp-admin/ in /home3/brighth7/public_html/dialhope/wp-content/themes/enfold/config-gutenberg/class-avia-gutenberg.php on line 693
I have looked at several threads in this forum and it appears to be a known issue. i have tried to turn off all plugins, tried classic and block editor modes, cleared cache.
I went into to Enfold theme’s config-gutenberg -> class-avia-gutenberg.php file and changed the 99 to 5 on this line of code as seen in on of your threads (https://kriesi.at/support/topic/error-enfold-with-plugin-salon-booking-wordpress-plugin/).
LINE 210: add_filter( ‘display_post_states’, array( $this, ‘handler_display_post_states’), 99, 2 );
I even see that with your latest update, you have a snippet of code (LINES: 695 – 718) in this file to address this specific issue. But the error persists on my site.
This site is running on the following versions:
php 7.4.30
WP 6.0
Enfold Theme 5.2.1.Can you please let me know if there is anything else I can try?
- This topic was modified 2 years, 1 month ago by dimrat.
October 27, 2022 at 3:42 pm #1370466Hey dimrat,
Thank you for using Enfold.
Seems one of the plugin is using the filter incorrect and returns a boolean value instead of an array.
What you can do:
config-gutenberg -> class-avia-gutenberg.php line 693:
public function handler_display_post_states( array $post_states, $post = null )
replace with:
public function handler_display_post_states( $post_states, $post = null )
And before
if( ! $post instanceof WP_Post ) { return $post_states; }
add:
if( ! is_array( $post_states ) ) { $post_states = array(); }
Do not forget to make a copy of the original file for a fallback.
If you need help with this let us know.
Fix will be included in next release 5.3
Best regards,
GünterOctober 27, 2022 at 8:55 pm #1370493Thank you so much Gunter. That worked!!
October 28, 2022 at 2:26 pm #1370565Hi,
Great, I’m glad that Günter could help you out. Please let us know if you should need any further help on the topic, or if we can close it.
Best regards,
RikardOctober 28, 2022 at 2:27 pm #1370566You can close this. Thank you!
October 28, 2022 at 4:14 pm #1370578Hi,
Thanks for letting us know, I’ll close this thread for now then. Please open a new thread if you should have any further questions or problems.
Best regards,
Rikard -
AuthorPosts
- The topic ‘Critical Error after updating plugin and Enfold Theme’ is closed to new replies.