clone_empty_start not working

Support General clone_empty_start not working

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #47295
    Nicholas CoxNicholas Cox
    Participant

    Hi

    When using 'clone_empty_start' to true the front end form does not hide the first group of fields? i am using the latest version of all plugins.

    [
    	'type' => 'group',
    	'id'   => 'product_package',
    	'name' => 'product package',
    	'group_title' => 'Product Package',
    	'clone' => true,
    	'sort_clone' => false,
    	'collapsible' => false,
    	'default_state' => 'expanded',
    	'save_state' => false,
    	'save_field' => true,
    	'clone_empty_start' => true,
    	'add_button' => '+ Add product',
    	'fields' => [
    		[
    			'type'  => 'number',
    			'name'  => 'Product',
    			'id'    => 'product_id', 
    			'step'  => '1', 
    			'placeholder'  => '',
    			//'min'  => '0',
    			//'max'  => '10000',
    			'sanitize_callback' => 'absint',
    			'required' => true,
    			'columns'  => 4,
    		],
    	]
    ]
    #47304
    PeterPeter
    Moderator

    Hello Nick,

    If you enable the field setting clone_empty_start, there is no group of fields on initial. When you click on the button "+ Add product", it will show the first group of fields.

    If it doesn't work on your site, this feature could be affected by a third-party plugin or a block of code in the theme. If so, can you please share the page URL where I can see the issue?

    #47306
    TomTom
    Participant

    I have this issue as well and came to this support forum to report it.

    "Clone Empty Start" doesn't work (ie the add more button doesn't show up) if you have a value in "Max number of clones" even if "min number of clones" is set to 0.

    It shows all the sub fields of the group and not the "add more" button if any value is in the "max number of clones".

    #47311
    PeterPeter
    Moderator

    Hello Tom,

    I set both max and min number of clones for the group field and the feature clone_empty_start still works properly.

    As the next step of troubleshooting, please share your site admin account by submitting this contact form https://metabox.io/contact/
    I will take a look.

    #47313
    TomTom
    Participant

    Okay I will. Can you just check this before I do...

    I should of mentioned this is Custom Fields Group assigned to a Settings Page. I just checked a different field group for a custom post type and when I assigned a max value everything worked fine.

    #47322
    Nicholas CoxNicholas Cox
    Participant

    Hi Peter,

    I did some investigation and turns out this CSS call I had in my custom CSS file (not metabox related) was causing the issue. So once I removed this all is working as it should.

    .rwmb-form .rwmb-clone.rwmb-clone-template {
      display: inherit;
    }
    #47371
    TomTom
    Participant

    Actual I take my last comment back. On another website I had it also not working for a CPT.

    I am sending in a support request.

    #47391
    PeterPeter
    Moderator

    The issue happens when the setting max number of clones set to 1 and if we set it to 2 or more, the setting clone_empty_start will work properly. The issue has been escalated to the development team, it will be fixed in the next update of our plugins.

    Thank you.

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