These are chat archives for WebDevStudios/CMB2

24th
Jul 2015
Justin Sternberg
@jtsternberg
Jul 24 2015 14:58
@sc0ttkclark they are not working yet, and I don't believe Camden ever started on it. I honestly don't think there will be too much to fix there, because it seems that the jQuery selectors are just too greedy
Scott Kingsley Clark
@sc0ttkclark
Jul 24 2015 15:01
so, best way forward -- any way you or Camden can walk me through it so i can put time into it?
we absolutely need it to move forward with Pods 3.0 + CMB2
Scott Kingsley Clark
@sc0ttkclark
Jul 24 2015 15:08
so it's a priority for me, although i may pass it on to another person on our team, i should be versed in it so i can divvy up tasks as necessary
maybe there's a github issue for it too
and i was wondering if that was the block of code that needed tweaking
Justin Sternberg
@jtsternberg
Jul 24 2015 15:11
Yah, addAjaxRow and addGroupRow are probably the culprits. I'm super-slammed since I was out of town this week, but best bet would be to add multiple repeat groups to a page and see how it breaks.. I think that will help narrow it down. I'd fix that problem first, and see if it fixes the repeat groups w/in repeat groups problem
Scott Kingsley Clark
@sc0ttkclark
Jul 24 2015 15:12
ok, thx, i'll try going through that and see what i can do
that person who posted the CMB2 admin UI plugin, i tested that code and saw it affecting that, so i might just use that as a quick and easy way to test / fix
Justin Sternberg
@jtsternberg
Jul 24 2015 15:12
ok, sorry I can't do more. Maybe we could setup a call next week if it would be helpful? But as of right now, that's all I know
Was that Marcus? the admin UI plugin?
sure, ping me if you get some time next week, i'll be around
Justin Sternberg
@jtsternberg
Jul 24 2015 15:13
Ah that's right
ok
Scott Kingsley Clark
@sc0ttkclark
Jul 24 2015 15:34
@twoelevenjay i installed it, but plugins disappeared immediately although i'm an admin, not sure what happened, but once i forced is_cmb2_allowed to return true, then went to settings, added my user 'admin' and removed my forced return true and that resolved it
Scott Kingsley Clark
@sc0ttkclark
Jul 24 2015 15:39

some other issues currently, some php notices:

Notice: Undefined variable: field_options in /srv/www/wordpress-default/wp-content/plugins/cmb2-admin-extension/includes/class-meta-box-post-type.php on line 580

Notice: Undefined index: _cmb2_options_textarea in /srv/www/wordpress-default/wp-content/plugins/cmb2-admin-extension/includes/class-meta-box-post-type.php on line 556

Notice: Undefined index: _cmb2_decription_textarea in /srv/www/wordpress-default/wp-content/plugins/cmb2-admin-extension/includes/class-meta-box-post-type.php on line 577

Notice: Undefined variable: field_options in /srv/www/wordpress-default/wp-content/plugins/cmb2-admin-extension/includes/class-meta-box-post-type.php on line 580

Scott Kingsley Clark
@sc0ttkclark
Jul 24 2015 15:51
ah, thought this one did groups but doesn't look like it, that's fine though
i'll try a custom implementation
Scott Kingsley Clark
@sc0ttkclark
Jul 24 2015 16:07
there we go
i can see it clearly now, the rain is gone
Scott Kingsley Clark
@sc0ttkclark
Jul 24 2015 18:43
@jtsternberg when you get a second, is this valid for adding group fields to group fields? http://sc0tt.me/image/2k0c2G1x3C38/Screen%20Shot%202015-07-24%20at%201.42.49%20PM.png
seems like valid syntax to me
but before i go down the hole, best to know if it's right or not
because i'm seeing empty rows with no fields output here for the tracks, just add/remove
i suspect it's more than just a JS issue
Scott Kingsley Clark
@sc0ttkclark
Jul 24 2015 19:13
i see now add_group_field returns an array:
return array( $parent_field_id, $field['id'] );
so i can get [1] and get around some of the notices i was seeing from array_key_exists
but it's still not working, so that wasn't the main part
Justin Sternberg
@jtsternberg
Jul 24 2015 19:13
Are you using the example form example-functions.php?
Scott Kingsley Clark
@sc0ttkclark
Jul 24 2015 19:14
i was using the code (modified for my purposes) from CMB2-Plugin-Example
Justin Sternberg
@jtsternberg
Jul 24 2015 19:14
I would use example-functions.php
I'm not sure how old that other thing is
Scott Kingsley Clark
@sc0ttkclark
Jul 24 2015 19:15
oh yeah that was old, and i updated all the syntax to use the new stuff in my code anyways
i don't even need the examples from that plugin now lol
Justin Sternberg
@jtsternberg
Jul 24 2015 19:15
ah ok
there's the code i'm using right now as a whole
in both cases, the sub groups don't output their fields
Justin Sternberg
@jtsternberg
Jul 24 2015 19:19
ah yah, I can already see some issues (requiring core-refactoring) with that.
Scott Kingsley Clark
@sc0ttkclark
Jul 24 2015 19:19
well i'll look into the code and see what i can help out with
we definitely want at least 2-3 levels (our admin ui will limit to 2 or 3 levels deep (group of fields in a group)
basically, adding a group field, it adds to the fields array, but only adds one level deep in the nested array.. It'll need to be updated to do more recursively then explicitly
recursion.. always a joy :D
Scott Kingsley Clark
@sc0ttkclark
Jul 24 2015 19:22
ah i see
yes, that looks fantastical
lol
i'll have a ponder
Justin Sternberg
@jtsternberg
Jul 24 2015 19:23
My brain took a beating to get it to work the way it currently works... Can't imagine the cerebral abuse required to get it to work recursively while not breaking back-compat. lol
Scott Kingsley Clark
@sc0ttkclark
Jul 24 2015 19:23
no one is using the object vars directly right?
Justin Sternberg
@jtsternberg
Jul 24 2015 19:23
which ones?
Scott Kingsley Clark
@sc0ttkclark
Jul 24 2015 19:23
CMB2 class properties
they're only using methods, right?
Justin Sternberg
@jtsternberg
Jul 24 2015 19:24
well.. I don't know that that's a given
Scott Kingsley Clark
@sc0ttkclark
Jul 24 2015 19:24
i'm not worried about supporting the old flat arrays for deep groups
(cmb2_meta_groups or whatever filter it was)
Justin Sternberg
@jtsternberg
Jul 24 2015 19:24
but, we can append the magic getter to grab them and provide updated ones if needed: https://github.com/WebDevStudios/CMB2/blob/master/includes/CMB2.php#L999-L1010
Scott Kingsley Clark
@sc0ttkclark
Jul 24 2015 19:24
yaeh
thx for taking some moments today with me, appreciate it
Justin Sternberg
@jtsternberg
Jul 24 2015 19:25
no problem, sorry I don't have more of them
Scott Kingsley Clark
@sc0ttkclark
Jul 24 2015 19:26
lol, know what you mean
i'm spread thin