TypeError in fields/post.php when showing revisions
Support › MB Revision › TypeError in fields/post.php when showing revisions
- This topic has 3 replies, 2 voices, and was last updated 3 years ago by
Peter.
-
AuthorPosts
-
December 7, 2022 at 10:20 PM #39588
dotsunited
ParticipantWe have got two custom post types, both with revisions enabled.
The second custom post type has a meta box with
revisionset totrueand a field of typepostwhich lets us select a single post of the first custom post type.After making changes to the actual value of this
postfield (= selecting a post and saving, so that there are multiple revisions), trying to display the revisions in the WordPress admin panel leads to an error in the main Meta Box plugin code.Full error output:
PHP Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, string given in [...]/wp-content/plugins/meta-box/inc/fields/post.php:108 Stack trace: #0 [...]/wp-content/plugins/meta-box/inc/field.php(533): RWMB_Post_Field::query() #1 [...]/wp-content/plugins/mb-revision/revision.php(175): RWMB_Field::call() #2 [...]/wp-content/plugins/mb-revision/revision.php(133): MB_Revision->transform_object_value_to_label() #3 [...]/wp-includes/class-wp-hook.php(310): MB_Revision->get_field_value_for_comparison() #4 [...]/wp-includes/plugin.php(205): WP_Hook->apply_filters() #5 [...]/wp-admin/includes/revision.php(91): apply_filters() #6 [...]/wp-admin/includes/ajax-actions.php(3527): wp_get_revision_ui_diff() #7 [...]/wp-includes/class-wp-hook.php(308): wp_ajax_get_revision_diffs() #8 [...]/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters() #9 [...]/wp-includes/plugin.php(517): WP_Hook->do_action() #10 [...]/wp-admin/admin-ajax.php(188): do_action() #11 {main} thrown in [...]/wp-content/plugins/meta-box/inc/fields/post.php on line 108The PHP version is 8.1.
December 9, 2022 at 9:18 AM #39628Peter
ModeratorHello,
Thanks for your feedback.
I've escalated this issue to the development team to fix it in the next update.
January 26, 2023 at 6:28 PM #40315dotsunited
ParticipantHi Peter,
can you give us an update for when the fixed is planed?
On https://metabox.io/plugins/meta-box-aio/changelog/ and https://metabox.io/plugins/mb-revision/ we see no progres yet.
thank you
January 28, 2023 at 11:33 AM #40338Peter
ModeratorHello,
This issue is fixed on this commit https://github.com/wpmetabox/meta-box/commit/d0a0f63fd290c16a980ca9948b7aacd7c40f1858
Please update Meta Box plugin to the latest version 5.6.15 and check this issue on your site again.Let me know how it goes.
-
AuthorPosts
- You must be logged in to reply to this topic.