Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Justin Sternberg
@jtsternberg
I see
PG Lewis
@pglewis
same array keys for the object list right now as the array list
as the branch stands, so it's been easy to start converting sections of code that were referencing the arrays
just point them at $field_objects instead of $fields_array
and refactor to call through to ->args on the object for the arrray stuff
current state is I'm still keeping both parallel but soon will drop the arrays hopefully and see how bad it blows up
and all of it seems to be working except for group fields, which was known it would be broken
none of that has been comitted or pushed yet though
no-fields-array is probably just a clone of no-metabox-array right now in the repo
PG Lewis
@pglewis
the no-metabox-array branch is just the refactor to remove the $meta_box property and transition to object props and I think that's viable
the no-fields-array branch will build from there, taking it the next step of trying to rid the field arrays... tougher
a unique ID per field-- a field GUID-- would be a great idea because it removes the need to have the parent ID for nested fields
but it has to work with the field ID / parent ID for back-compat first, so I'm starting the refactor that way
PG Lewis
@pglewis
thus field IDs only should need to be unique within their field group
which is how it is now, pretty sure
Justin Sternberg
@jtsternberg
yep, that's how it is currently, but seems to me we should generate a guid and store it as a field object property
and add_field could return that guid
PG Lewis
@pglewis
I like that idea as an enhancement if we get it that far
Justin Sternberg
@jtsternberg
yah for sure
PG Lewis
@pglewis
simplifies things from the consuming side of the API
Justin Sternberg
@jtsternberg
and that guid could maybe be generated programmatically by parsing all the field parents so that it can be reverse-engineered to figure out its nesting level.. may be too ambitious, but a thought
PG Lewis
@pglewis
and, yeah, for back compat, I think we can just foreach and dump each object's args for calls to cmb2::fields
Justin Sternberg
@jtsternberg
or I guess parent guid, like a term's parent id
to get to the top, keep checking parent guid till it's 0
PG Lewis
@pglewis
pulling the stack and answering something you asked a while ago :)
Justin Sternberg
@jtsternberg
got it
PG Lewis
@pglewis
with the main field array done away with, field objects always instantiated, and fields and the metabox extending the field group object, nested field handling issue mostly evaporate:
cmb2-nested-data.png
the metabox and fields both have access to the field management functions and can add fields to themselves
so there's nesting two levels right there, and it theoretically should support arbitrary levels
still clean up to do, but that there's a breakthrough
PG Lewis
@pglewis
discog-nested-01.png
Scott Kingsley Clark
@sc0ttkclark
So beautiful
@jtsternberg ^^ phil just got that happening
Justin Sternberg
@jtsternberg
would you look at that!
nice work @pglewis!
PG Lewis
@pglewis
don't ask if it loads or saves data
Justin Sternberg
@jtsternberg
ha ha
pglewis @pglewis hand waves past that
PG Lewis
@pglewis
proof of concept achieved though
Justin Sternberg
@jtsternberg
absolutely
Scott Kingsley Clark
@sc0ttkclark
thoughts on anything there we could apply to CMB2 itself?
in terms of UI
Justin Sternberg
@jtsternberg
I like the hover-highlight thing, though I think it could be a little more subtle. What else do you have in mind?
Scott Kingsley Clark
@sc0ttkclark
just threw that out there in case it was something we could reach into for the CMB2 refactor of the frontend
any plans for time on backbone / etc there for you? know anyone we could reach out to for additional help?
PG Lewis
@pglewis
the time is now for me to get onboard with backbone anyway, so within a week I'll be a fledgling resource there
Justin Sternberg
@jtsternberg
based on your work so far, that's an encouraging aspect.
@sc0ttkclark my only thought is possibly @ericandrewlewis would be interested.