field type taxonomy advanced - not populating data in the metabox

Support General field type taxonomy advanced - not populating data in the metaboxResolved

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #39934
    Prabakaran ShankarPrabakaran Shankar
    Participant

    Hello,
    Im using field type taxonomy advanced. It is storing the data properly, but not populating the content after refresh.
    https://loom.com/share/e3cfaed63cc949c58ba35ee2463efd62

    code use to generate metabox

    <?php
    add_filter( 'rwmb_meta_boxes', 'your_prefix_function_name' );
    
    function your_prefix_function_name( $meta_boxes ) {
        $prefix = '';
    
        $meta_boxes[] = [
            'title'        => __( 'Custom Query Parameters', 'your-text-domain' ),
            'id'           => 'custom-query-block',
            'post_types'   => ['page'],
            'storage_type' => 'custom_table',
            'table'        => 'custom',
            'fields'       => [
                [
                    'name'   => __( 'Query Parameters', 'your-text-domain' ),
                    'id'     => $prefix . 'nvs_query_parameters',
                    'type'   => 'group',
                    'fields' => [
                        [
                            'name'     => __( 'Custom Query', 'your-text-domain' ),
                            'id'       => $prefix . 'custom_query',
                            'type'     => 'radio',
                            'options'  => [
                                'yes' => __( 'Category Page', 'your-text-domain' ),
                                'no'  => __( 'Not a Category Page', 'your-text-domain' ),
                            ],
                            'required' => true,
                        ],
                        [
                            'name'    => __( 'Post type', 'your-text-domain' ),
                            'id'      => $prefix . 'post_type',
                            'type'    => 'select_advanced',
                            'options' => [
                                'post'    => __( 'Post', 'your-text-domain' ),
                                'page'    => __( 'Page', 'your-text-domain' ),
                                'job'     => __( 'Job', 'your-text-domain' ),
                                'emp'     => __( 'Employer', 'your-text-domain' ),
                                'scholar' => __( 'Scholarships', 'your-text-domain' ),
                            ],
                            'columns' => 4,
                            'visible' => [
                                'when'     => [['custom_query', '=', 'yes']],
                                'relation' => 'or',
                            ],
                        ],
                        [
                            'name'       => __( 'Current Status', 'your-text-domain' ),
                            'id'         => $prefix . 'current_status',
                            'type'       => 'taxonomy_advanced',
                            'taxonomy'   => ['current-status'],
                            'field_type' => 'select_advanced',
                            'multiple'   => true,
                            'columns'    => 4,
                            'visible'    => [
                                'when'     => [['custom_query', '=', 'yes']],
                                'relation' => 'or',
                            ],
                        ],
                        [
                            'name'       => __( 'Country', 'your-text-domain' ),
                            'id'         => $prefix . 'country',
                            'type'       => 'taxonomy_advanced',
                            'taxonomy'   => ['country'],
                            'field_type' => 'select_advanced',
                            'multiple'   => true,
                            'columns'    => 4,
                            'visible'    => [
                                'when'     => [['custom_query', '=', 'yes']],
                                'relation' => 'or',
                            ],
                        ],
                        [
                            'name'       => __( 'Position', 'your-text-domain' ),
                            'id'         => $prefix . 'position',
                            'type'       => 'taxonomy_advanced',
                            'taxonomy'   => ['position'],
                            'field_type' => 'select_advanced',
                            'multiple'   => true,
                            'columns'    => 4,
                            'visible'    => [
                                'when'     => [['custom_query', '=', 'yes']],
                                'relation' => 'or',
                            ],
                        ],
                        [
                            'name'       => __( 'Subjects', 'your-text-domain' ),
                            'id'         => $prefix . 'subjects',
                            'type'       => 'taxonomy_advanced',
                            'taxonomy'   => ['post_tag'],
                            'field_type' => 'select_advanced',
                            'multiple'   => true,
                            'query_args' => [
                                'number' => 50,
                            ],
                            'columns'    => 4,
                            'visible'    => [
                                'when'     => [['custom_query', '=', 'yes']],
                                'relation' => 'or',
                            ],
                        ],
                        [
                            'name'       => __( 'Workplace', 'your-text-domain' ),
                            'id'         => $prefix . 'workplace',
                            'type'       => 'taxonomy_advanced',
                            'taxonomy'   => ['workplace'],
                            'field_type' => 'select_advanced',
                            'multiple'   => true,
                            'columns'    => 4,
                            'visible'    => [
                                'when'     => [['custom_query', '=', 'yes']],
                                'relation' => 'or',
                            ],
                        ],
                        [
                            'name'       => __( 'Country 2', 'your-text-domain' ),
                            'id'         => $prefix . '2cou',
                            'type'       => 'taxonomy_advanced',
                            'taxonomy'   => ['country'],
                            'field_type' => 'select_advanced',
                            'multiple'   => true,
                            'columns'    => 4,
                            'visible'    => [
                                'when'     => [['custom_query', '=', 'yes']],
                                'relation' => 'or',
                            ],
                        ],
                        [
                            'name'       => __( 'Position 2', 'your-text-domain' ),
                            'id'         => $prefix . '2pos',
                            'type'       => 'taxonomy_advanced',
                            'taxonomy'   => ['position'],
                            'field_type' => 'select_advanced',
                            'multiple'   => true,
                            'columns'    => 4,
                            'visible'    => [
                                'when'     => [['custom_query', '=', 'yes']],
                                'relation' => 'or',
                            ],
                        ],
                        [
                            'name'       => __( 'Subjects 2', 'your-text-domain' ),
                            'id'         => $prefix . '2sub',
                            'type'       => 'taxonomy_advanced',
                            'taxonomy'   => ['post_tag'],
                            'field_type' => 'select_advanced',
                            'multiple'   => true,
                            'query_args' => [
                                'number' => 50,
                            ],
                            'columns'    => 4,
                            'visible'    => [
                                'when'     => [['custom_query', '=', 'yes']],
                                'relation' => 'or',
                            ],
                        ],
                        [
                            'name'       => __( ' Workplace 2', 'your-text-domain' ),
                            'id'         => $prefix . '2wor',
                            'type'       => 'taxonomy_advanced',
                            'taxonomy'   => ['workplace'],
                            'field_type' => 'select_advanced',
                            'multiple'   => true,
                            'columns'    => 4,
                            'visible'    => [
                                'when'     => [['custom_query', '=', 'yes']],
                                'relation' => 'or',
                            ],
                        ],
                        [
                            'name'       => __( 'Status Type', 'your-text-domain' ),
                            'id'         => $prefix . 'status_type',
                            'type'       => 'taxonomy_advanced',
                            'taxonomy'   => ['status-type'],
                            'field_type' => 'select_advanced',
                            'multiple'   => true,
                            'columns'    => 4,
                            'visible'    => [
                                'when'     => [['custom_query', '=', 'yes']],
                                'relation' => 'or',
                            ],
                        ],
                        [
                            'name'    => __( 'Posts per page', 'your-text-domain' ),
                            'id'      => $prefix . 'posts_per_page',
                            'type'    => 'number',
                            'columns' => 4,
                        ],
                        [
                            'name'    => __( 'Custom ID', 'your-text-domain' ),
                            'id'      => $prefix . 'custom_id',
                            'type'    => 'text',
                            'columns' => 4,
                            'visible' => [
                                'when'     => [['custom_query', '=', 'yes']],
                                'relation' => 'or',
                            ],
                        ],
                        [
                            'name'      => __( 'Filters Option', 'your-text-domain' ),
                            'id'        => $prefix . 'filters_option',
                            'type'      => 'switch',
                            'on_label'  => 'ON',
                            'off_label' => 'OFF',
                            'std'       => true,
                            'columns'   => 4,
                            'visible'   => [
                                'when'     => [['custom_query', '=', 'yes']],
                                'relation' => 'or',
                            ],
                        ],
                        [
                            'name'    => __( 'Filter Choices', 'your-text-domain' ),
                            'id'      => $prefix . 'filter_choices',
                            'type'    => 'checkbox_list',
                            'options' => [
                                2  => __( 'Positions', 'your-text-domain' ),
                                3  => __( 'Countries', 'your-text-domain' ),
                                23 => __( 'Workplace', 'your-text-domain' ),
                                16 => __( 'Subjects', 'your-text-domain' ),
                                18 => __( 'Info Types', 'your-text-domain' ),
                                20 => __( 'Qualifications', 'your-text-domain' ),
                                12 => __( 'Pagination', 'your-text-domain' ),
                            ],
                            'columns' => 4,
                        ],
                        [
                            'name'              => __( 'Display Block Settings', 'your-text-domain' ),
                            'id'                => $prefix . 'dbsg',
                            'type'              => 'checkbox',
                            'label_description' => __( 'elements to not display in each block', 'your-text-domain' ),
                            'columns'           => 4,
                        ],
                        
                    ],
                ],
            ],
        ];
    
        return $meta_boxes;
    }
    #39943
    PeterPeter
    Moderator

    Hello,

    Can you please test to create a new field group with the same taxonomy advanced fields and save data to a new custom table to see if it works? I've experienced with the same issue before but it works when I create a new field group and custom table.

    #39950
    Prabakaran ShankarPrabakaran Shankar
    Participant

    Hello Peter,

    Thanks for the information and the idea. Based on that, I've checked with a new custom table and group field with taxonomy advanced and individual taxonomy advanced.

    <?php
    add_filter( 'rwmb_meta_boxes', 'your_prefix_function_name' );
    
    function your_prefix_function_name( $meta_boxes ) {
        $prefix = '';
    
        $meta_boxes[] = [
            'title'        => __( 'Job Meta - Logo', 'your-text-domain' ),
            'id'           => 'job-meta-logo',
            'post_types'   => ['page'],
            'storage_type' => 'custom_table',
            'table'        => 'custom_table',
            'fields'       => [
                [
                    'name'   => __( 'Group', 'your-text-domain' ),
                    'id'     => $prefix . 'page_qryparams',
                    'type'   => 'group',
                    'fields' => [
                        [
                            'name'       => __( 'Countries list', 'your-text-domain' ),
                            'id'         => $prefix . 'couq1_dadsaf',
                            'type'       => 'taxonomy_advanced',
                            'taxonomy'   => ['country'],
                            'field_type' => 'select_advanced',
                            'multiple'   => true,
                        ],
                        [
                            'name'       => __( 'Taxonomy', 'your-text-domain' ),
                            'id'         => $prefix . 'taxonomy_b6txshpk8ct',
                            'type'       => 'taxonomy',
                            'field_type' => 'select_advanced',
                        ],
                    ],
                ],
                [
                    'name'       => __( 'Taxonomy Advanced', 'your-text-domain' ),
                    'id'         => $prefix . 'tx_123',
                    'type'       => 'taxonomy_advanced',
                    'taxonomy'   => ['country'],
                    'field_type' => 'select_advanced',
                ],
            ],
        ];
    
        return $meta_boxes;
    }

    check out the image for output.
    output of tax_advanced
    For both input, data stored in the custom table without any problem. The results are not positive for taxonomy advanced inside the group field. However, the individual taxonomy advanced field populate the content.

    #39961
    PeterPeter
    Moderator

    Hello,

    Thanks for your feedback.

    I can reproduce the issue on my demo site and I've escalated this issue to the development team to fix it in the next update.

    #39967
    Prabakaran ShankarPrabakaran Shankar
    Participant

    Thanks.

    #39989
    Prabakaran ShankarPrabakaran Shankar
    Participant

    Hello, is there a chance for a fast repair, patch, or file?

    #39990
    PeterPeter
    Moderator

    Hello,

    Yes, please check the fix here https://github.com/wpmetabox/meta-box/commit/d18fe9a84d29fab1b66a5454b19b05c8c7cc380d

    #39994
    Prabakaran ShankarPrabakaran Shankar
    Participant

    Thank you for providing an update. It's effective...

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.