• Resolved kemoboy

    (@kemoboy)


    I encounter a small problem with your latest vesrion. The wysiwyg field type is not working properly.

    It displays on the editor (gutenberg) but that’s it all… I can’t edit anything in it. It won’t let me click inside it to add text.

    CMB2 wysiwyg NOT WORKING!

    How can i fix this problem, thank you!

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Hi @kemoboy can you provide the CMB2 code you’re using when registering your fields?

    Also can you confirm which version of WordPress core you’re using?

    Will see if I can recreate the issue using the settings you’re using.

    Early hunch is that perhaps you’re encountering some javascript errors on the editor screen that’s preventing some things from working.

    Thread Starter kemoboy

    (@kemoboy)

    Hello, @tw2113,

    I’m using WordPress 5.7.1

    Here is the code for registering the metaboxes:

    add_action( 'cmb2_init', 'campus_register_metaboxes' );
    function campus_register_metaboxes() {
     // About page - TV 
    	$about_page_team_tv = new_cmb2_box( [
    		'id'            => $prefix.'tv_info',
    		'title'         => esc_html__( 'TV Info ', 'campus-buzau' ),
    		'object_types'  => [ 'page' ],
    		'show_on'      	=> array( 'key' => 'page-template', 'value' => 'template-despre-noi.php' ),
    		'show_in_rest'  => WP_REST_Server::ALLMETHODS,
        ] );
    
    	$about_page_team_tv->add_field( array(
    		'name'    => 'Info',
    		'id'      => 'tv_team_info',
    		'type'    => 'wysiwyg',
    		'options' => array(),
    	) );
    
    	$about_team_tv = $about_page_team_tv->add_field( array(
    		'id'          => $prefix.'tv_team_members',
    		'type'        => 'group',
    		'options'     => array(
    			'group_title'       => esc_html__( 'Membru echipa TV {#}', 'campus-buzau' ), // since version 1.1.4, {#} gets replaced by row number
    			'add_button'        => esc_html__( 'Aduaga', 'campus-buzau' ),
    			'remove_button'     => esc_html__( 'Sterge', 'campus-buzau' ),
    			'sortable'          => true,
    			'closed'         	=> true, // true to have the groups closed by default
    		),
    	) );
    
    	$about_team_tv = $about_page_team_tv->add_field( array(
    		'id'          => $prefix.'tv_team_members',
    		'type'        => 'group',
    		'repeatable'  => true,
    		'options'     => array(
    			'group_title'       => esc_html__( 'Membru echipa TV {#}', 'campus-buzau' ), // since version 1.1.4, {#} gets replaced by row number
    			'add_button'        => esc_html__( 'Aduaga', 'campus-buzau' ),
    			'remove_button'     => esc_html__( 'Sterge', 'campus-buzau' ),
    			'sortable'          => true,
    			'closed'         	=> true, // true to have the groups closed by default
    		),
    	) );
    }

    There are no errors in the console, I check that multiple times. I tried removing all the other metaboxes, register them again with another id and it doesn’t seem to work.

    I use this specific metaboxes on a page, but only if a a specific page template is applied.

    Thank you for your time, I apreciate it!

    Thread Starter kemoboy

    (@kemoboy)

    the $prefix variable exists… I just missed it when I copid the code.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Curious if details from https://github.com/CMB2/CMB2/issues/1397 and https://core.trac.wordpress.org/ticket/52050 are playing their parts in this still.

    Definitely able to reproduce in editor version but classic editor is working fine.

    If the GitHub issue above is indeed playing it’s part, then it’s a detail that trickles into WordPress core, and not CMB2.

    Thread Starter kemoboy

    (@kemoboy)

    So there is no actual solution, yet. 🙁

    Thank you for your time! 😀

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    If this all applies, correct, at least with using Block editor views. If you’re good with classic editor for the moment, then the field works fine still.

    @tw2113 I think this ticket will fix the problem:
    https://core.trac.wordpress.org/ticket/52050

    I don’t know if it helps, but with Chrome-Browsers it works well.
    In Firefox you cannot place a cursor anywhere in the field.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Matches up with what I mentioned earlier in the thread, so i’m hopeful.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Wysiwyg field type is not woroking.’ is closed to new replies.