Nested groups conflict
- This topic has 6 replies, 3 voices, and was last updated 8 years, 8 months ago by
Anh Tran.
-
AuthorPosts
-
August 13, 2016 at 4:47 AM #3846
wefit.lucas
ParticipantHi, I'm using nested groups in my application but I'm having trouble with the clones and the hidden/visibility conditionals.
The problem occurs when I add a cloneable group (level 3) inside a group (level 2) that is already inside a cloneable group (level 1). When I do that, is possible to delete all the cloneables group until I have a blank screen and the button '+ Add more' no longer works.
Also, if I use a conditional at this level, it also stops working.
$meta_boxes[] = array( 'title' => __( 'Metabox 1', 'textdomain' ), 'id' => 'metabox1', 'post_types' => 'rep_page', 'fields' => array( array( 'id' => 'group1', 'type' => 'group', 'clone' => true, 'sort_clone' => true, 'fields' => array( array( 'id' => 'select1', 'name' => __( 'Select 1', 'textdomain' ), 'type' => 'select', 'placeholder' => 'Select', 'options' => array( 1 => 'Subgroup 1', 2 => 'Subgroup 2', ), ), array( 'id' => 'subgroup1', 'type' => 'group', 'hidden' => array('select1', '!=', 1), 'fields' => array( array( 'id' => 'subtext1', 'name' => __( 'Subtext 1', 'textdomain' ), 'type' => 'text', 'placeholder' => 'Text', ), ), ), array( 'id' => 'subgroup2', 'type' => 'group', 'hidden' => array('select1', '!=', 2), 'fields' => array( array( 'id' => 'subtext2', 'name' => __( 'Subtext 2', 'textdomain' ), 'type' => 'text', 'placeholder' => 'Text', ), array( 'id' => 'sub_subgroup1', 'type' => 'group', 'clone' => true, 'sort_clone' => true, 'max_clone' => 3, 'fields' => array( array( 'id' => 'sub_subselect1', 'name' => __( 'Sub Sub Select 1', 'textdomain' ), 'type' => 'select', 'placeholder' => 'Select', 'options' => array( 1 => 'Sub Sub Subgroup 1', 2 => 'Sub Sub Subgroup 2', ), ), array( 'id' => 'sub_sub_subgroup1', 'type' => 'group', 'hidden' => array('sub_subselect1', '!=', 1), 'fields' => array( array( 'id' => 'sub_sub_subtext1', 'name' => __( 'Sub Sub Subtext 1', 'textdomain' ), 'type' => 'text', 'placeholder' => 'Text', ), ), ), array( 'id' => 'sub_sub_subgroup2', 'type' => 'group', 'hidden' => array('sub_subselect2', '!=', 2), 'fields' => array( array( 'id' => 'sub_sub_subtext2', 'name' => __( 'Sub Sub Subtext 2', 'textdomain' ), 'type' => 'text', 'placeholder' => 'Text', ), ), ), ), ), ), ), ), ), ), );
August 15, 2016 at 10:02 AM #3847Anh Tran
KeymasterHi Lucas,
Currently, the logic of the clone is keeping the 1st entries for users to enter data. It's applied not only to groups, but also all fields.
Regarding the conditional check, have you updated both the group and conditional logic plugins to the latest version? We've just fixed a bug to make them work together.
Thanks
AnhAugust 16, 2016 at 4:15 AM #3853wefit.lucas
ParticipantHi Anh,
Thanks for the response. I'm currently using the conditional-logic v1.3 and metabox group v1.1.4.
August 16, 2016 at 10:00 AM #3856Anh Tran
KeymasterThanks. Let me check the Conditional Logic extension with my developer.
August 19, 2016 at 10:33 PM #3895Tan Nguyen
ParticipantDear wefit,
I've fixed Sub Sub Sub field doesn't works. Please grab the latest version (1.3.1)
August 20, 2016 at 12:23 AM #3896wefit.lucas
ParticipantUpdated here, the conditional logic seems to be working now. Thanks Tan.
Still waiting for the group problem. I'm still able to delete all groups in this code example. How can I fix this?
Thanks.
August 22, 2016 at 8:36 AM #3901Anh Tran
KeymasterI'm afraid we will keep the current logic, e.g. always keep at least 1 clone. There's no work around it at the moment.
Best regards
Anh -
AuthorPosts
- The topic ‘Nested groups conflict’ is closed to new replies.