Skip to content

Wysiwyg visual tab doesn't save content when Gutenberg is also activated #1156

@LC43

Description

@LC43

Expected Behavior:

When saving a post, the contents of the field are saved.

Actual Behavior:

The changes are not saved. They're only saved when using the tab "text".

Steps to reproduce

I have confirmed I can reproduce this issue on the trunk branch: ✔️

  1. Enable CMB2 & Gutemberg

  2. Add wysiwyg field

  3. Edit a post and add content to the field wysiwyg 'Content', on the tab "Visual".

  4. Refresh and notice that the content is not saved.

  5. Edit a post and add content to the field wysiwyg 'Content', on the tab "Text".

  6. Refresh and notice that the content is saved.

Versions

  • CMB2 : 2.4.2
  • Gutenberg : 3.4.0
  • WP : 4.9.7

CMB2 Field Registration Code:

add_action( 'cmb2_admin_init', 'yourprefix_register_demo_metabox' );
function yourprefix_register_demo_metabox() {

		$prefix = '_our_info_';

		$cmb = new_cmb2_box( array(
			'id'            => 'test_id',
			'title'         => 'Details',
			'object_types'  => array( 'post' ),
			'context'       => 'normal',
			'priority'      => 'high',
			'show_names'    => true,
		) );

		$cmb->add_field( array(
			'name'        => __( 'Content', 'our-post-types' ),
			'description' => __( 'Has limit space.', 'our-post-types' ),
			'id'          => $prefix . 'description',
			'type'        => 'wysiwyg',
		) );

	// Additional fields...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions