Uncaught TypeError: Cannot read property 'replace' of undefined
.../app/plugins/cmb2/js/cmb2.min.js?ver=2.2.2.1 line 1
add_action( 'cmb2_admin_init', 'yourprefix_register_demo_metabox' );
function yourprefix_register_demo_metabox() {
$prefix = 'kumbaya';
$cmb = new_cmb2_box( array(
'id' => 'test_metabox',
'title' => __( 'Settings', 'cmb2' ),
'object_types' => array( 'my_post_type', ), // Post type
'context' => 'normal',
'priority' => 'high',
'show_names' => true, // Show field names on the left
) );
$group_field_id = $cmb->add_field( array(
'id' => 'wiki_test_repeat_group',
'type' => 'group',
'description' => __( 'Set of Fields Settings', 'cmb2' ),
'repeatable' => false, // use false if you want non-repeatable group
'options' => array(
'group_title' => __( 'Group Name', 'cmb2' ),
'add_button' => __( 'Add Another Entry', 'cmb2' ),
'remove_button' => __( 'Remove Entry', 'cmb2' ),
'sortable' => true, // beta
),
) );
// Title
$cmb->add_group_field( $group_field_id, array(
'name' => __( 'Title', 'cmb2' ),
'description' => __( 'field description (optional)', 'cmb2' ),
'id' => $prefix . '_title',
'type' => 'text',
'attributes' => [],
'repeatable' => true, // Repeatable fields are supported w/in repeatable groups (for most types)
) );
}
Expected Behavior:
Removing newly added repeatable
textfield from a group should not produce js error.Actual Behavior:
Here is the error that I receive:
Steps to reproduce:
groupfield, with several field in ittextfields repeatable.Add Rowbutton under this field.Removebutton on any of that repeatable itemsCMB2 Field Registration Code: