Skip to content

The word 'false' is saved in empty text repeater fields in v2.4.0 #1138

Closed

Description

@lumpysimon

This issue affects v2.4.0 but not v2.3.0

When adding new items to a repeater text field and leaving them blank, the items should not be saved. In v2.4.0 the items are saved and contain the word false. This means when displaying the field values on the front end, the word false is returned and displayed.

To reproduce:

  • Create a field with 'type' => 'text' and 'repeatable' => true
  • Add an item to the field with a value in it
  • Add a second item with no value
  • Save the post
  • The second item will contain the word false

screen shot 2018-05-25 at 09 13 35

Activity

  1. added a commit that references this issue on May 25, 2018
    32e7761
  2. jtsternberg commented on May 25, 2018

    @jtsternberg
    Member

    Fixed in 2.4.1. Thank you for the helpful bug report.

  3. JiveDig commented on May 26, 2018

    @JiveDig

    @jtsternberg I'm testing 2.4.1 now and still getting false in a repeatable WYSIWYG field. Tested on 2 different installs. If I add 'default' => '', to the WYSIWYG field, then it's fine.

  4. jtsternberg commented on May 29, 2018

    @jtsternberg
    Member

    @JiveDig as always, can you pretty please provide your configuration code so we can test w/ the same thing?

  5. JiveDig commented on May 29, 2018

    @JiveDig

    Sorry @jtsternberg, I think i was too excited for 🍺 on Memorial Day weekend ;P

    add_action('cmb2_init', function() {
    
    	$cmb = new_cmb2_box([
    		'id'           => 'test',
    		'title'        => 'Test',
    		'object_types' => ['post'],
    		'context'      => 'normal',
    		'priority'     => 'default'
    	]);
    
    	$group_field_id = $cmb -> add_field([
    		'id'   => 'group',
    		'type' => 'group'
    
    	]);
    
    	$cmb->add_group_field( $group_field_id, array(
    		'name' => __( 'Content', 'textdomain' ),
    		'id'   => 'content',
    		'type' => 'wysiwyg',
    	) );
    
    }, 20, 2 );
    
  6. jtsternberg commented on May 29, 2018

    @jtsternberg
    Member

    Ha, I hear that. It should be fixed with 2.4.2. Please let me know.

  7. JiveDig commented on May 29, 2018

    @JiveDig

    Yessir, works in 2.4.2 thanks!

  8. lumpysimon commented on May 30, 2018

    @lumpysimon
    Author

    Thanks @jtsternberg for the quick fix on this, all working great again now.

  9. added a commit that references this issue on Oct 12, 2026
    a0e61f5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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