Support Forum » User Profile

Forum Replies Created

Viewing 2 posts - 16 through 17 (of 17 total)
  • Author
    Posts
  • in reply to: Fatal Error in class-mb-custom-table-loader.php on line 58 #23398
    DANIEL FITIPALDO R.DANIEL FITIPALDO R.
    Participant

    Hi Long,
    I could finally replicate the fatal error. I hope you can replicate it as well with the following instructions.
    1) Login as admin with twenty-twenty theme.
    2) Enable Autosave (60 sec as default)
    3) Create Post Type 'Test PT' with 'publicly_queryable' => true

    <div>
    function your_prefix_register_post_type() {
    
        $args = array (
            'label' => esc_html__( 'Tests PT', 'text-domain' ),
            'labels' => array(
                'menu_name' => esc_html__( 'Tests PT', 'text-domain' ),
                'name_admin_bar' => esc_html__( 'Test PT', 'text-domain' ),
                'add_new' => esc_html__( 'Add new', 'text-domain' ),
                'add_new_item' => esc_html__( 'Add new Test PT', 'text-domain' ),
                'new_item' => esc_html__( 'New Test PT', 'text-domain' ),
                'edit_item' => esc_html__( 'Edit Test PT', 'text-domain' ),
                'view_item' => esc_html__( 'View Test PT', 'text-domain' ),
                'update_item' => esc_html__( 'Update Test PT', 'text-domain' ),
                'all_items' => esc_html__( 'All Tests PT', 'text-domain' ),
                'search_items' => esc_html__( 'Search Tests PT', 'text-domain' ),
                'parent_item_colon' => esc_html__( 'Parent Test PT', 'text-domain' ),
                'not_found' => esc_html__( 'No Tests PT found', 'text-domain' ),
                'not_found_in_trash' => esc_html__( 'No Tests PT found in Trash', 'text-domain' ),
                'name' => esc_html__( 'Tests PT', 'text-domain' ),
                'singular_name' => esc_html__( 'Test PT', 'text-domain' ),
            ),
            'public' => true,
            'exclude_from_search' => false,
            'publicly_queryable' => true,
            'show_ui' => true,
            'show_in_nav_menus' => true,
            'show_in_admin_bar' => true,
            'show_in_rest' => true,
            'menu_icon' => 'dashicons-admin-appearance',
            'capability_type' => 'post',
            'hierarchical' => false,
            'has_archive' => true,
            'query_var' => true,
            'can_export' => true,
            'supports' => array(
                'title',
                'editor',
                'comments',
                'revisions',
            ),
            'rewrite' => array(
                'with_front' => false,
            ),
        );
    
        register_post_type( 'test-pt', $args );
    }
    add_action( 'init', 'your_prefix_register_post_type' );
    </div>

    4) Create Custom Field 'Test CF' for the post type 'test-pt'

    <div>
    <?php
    add_filter( 'rwmb_meta_boxes', 'your_prefix_register_meta_boxes' );
    
    function your_prefix_register_meta_boxes( $meta_boxes ) {
        $prefix = '';
    
        $meta_boxes[] = [
            'title'      => esc_html__( 'Test CF', 'text-domain' ),
            'id'         => 'test-cf',
            'post_types' => ['test-pt'],
            'context'    => 'normal',
            'priority'   => 'high',
            'fields'     => [
                [
                    'id'   => $prefix . 'text_tpdykx1qs3k',
                    'type' => 'text',
                    'name' => esc_html__( 'Text Field CF', 'text-domain' ),
                ],
            ],
        ];
    
        return $meta_boxes;
    }
    </div>

    5) Create Custom Field 'Test BLCK' with 'mode' => 'edit'

    <div>
    <?php
    add_filter( 'rwmb_meta_boxes', 'your_prefix_register_meta_boxes' );
    
    function your_prefix_register_meta_boxes( $meta_boxes ) {
        $prefix = '';
    
        $meta_boxes[] = [
            'title'    => esc_html__( 'Test BLCK', 'text-domain' ),
            'id'       => 'test-blck',
            'fields'   => [
                [
                    'id'   => $prefix . 'text_hdsmywqrchf',
                    'type' => 'text',
                    'name' => esc_html__( 'Text Field Test BLCK', 'text-domain' ),
                ],
            ],
            'category' => 'layout',
            'icon'     => 'admin-appearance',
            'type'     => 'block',
            'mode'     => 'edit',
        ];
    
        return $meta_boxes;
    }
    </div>

    6) Create a new Test PT post, insert Test BLCK block in the block editor content. Add some text to the title and both fields ('Test CF' and 'Test BLCK'), and save as draft. Then press Publish button, view the post in the Front End, return to the Editor screen clicking on the Editor button in the bottom part of the post.
    7) Once returned to the editor screen, update both fields but do not save!!, wait for Autosave to do that (+60 secs). Once Autosave saved, press Update, view the post in the Front End again, click the Edit button as in 6), and voila, you will get the fatal error.

    DANIEL FITIPALDO R.DANIEL FITIPALDO R.
    Participant

    Hi Long,
    It's not an easy issue to replicate because it seems that there is a timing condition involved and could be a cache problem. I will continue to investigate the issue and I'll get back to you with more information.
    You can close this ticket if you want.
    thanks!
    Daniel

Viewing 2 posts - 16 through 17 (of 17 total)