Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
PG Lewis
@pglewis
no, named after nested fields
nested-fields-trunk
Justin Sternberg
@jtsternberg
ah, there it s
what do you have in mind, if NOT doing it this way?
PG Lewis
@pglewis
there's still a lot of duct tape just to get things to pass tests and things are in mid-refactor
all fields appear to be working except any group fields at the moment
still a handful of things to track down there
I'm not sure I have a Plan B at the moment...
at the point I had achieved at least display of nested fields and things were pretty much back-compat, I figured this is pitch-able as solution
Justin Sternberg
@jtsternberg
absolutely
PG Lewis
@pglewis
though I think another refactor pass on the fields object will simplify the remaining sticky bits
my main concern was "can this even be done and be remotely back compat"
I was amazed that it just might be
but user mbs, options page mb, mb on pages all seem to save an load, images... multi images
just no groups yet until I complete the unborking there
and fields data structure is becoming the major bottle neck to that
CMB2 and the fields group objects are slowly getting hammered into better shape
so if this moves forward, the plan would be: finish up passing tests, test against metabox example code, test saving from group and nested group fields
and then: break tests again by refactoring fields
get it stable in a wave of refactoring, start the next
if it doesn't move forward, I need to learn my alternative approach
Justin Sternberg
@jtsternberg
'just no groups yet until I complete the unborking there'
isn't that what this is about?
nested groups basically?
PG Lewis
@pglewis
I know a lot more about the structure now than when I went in
all group fields are currently broken for at least either saving or loading
since the structure under the hood changed and I haven't tracked down the last bits of broken there
like 3 tests failing, which are likely the culprits
but it's getting into the field objects now... field options staying in synch
less and less things to fix in CMB2 and the Field Groups class
and more and more things I'm tracing around the rabbit hole in fields
Justin Sternberg
@jtsternberg
gotcha
PG Lewis
@pglewis
rendering is close to right, some options not getting set to put the button text on the add/remove buttons
so the borked part of groups is either saving, loading, or both
haven't even checked the meta table 'cause i figured I'd get it to pass tests first then see where it lands
last couple were starting to make me lose hair though lol
PG Lewis
@pglewis
and this kludgy bit of code should at least display mostly right on page edit:
again, note I'm pretty much just using add_field() for everything since field objects can now do that
so, from a consuming side, the API can be very easy to do nesting with, no special fiddling
and it simplifies adding group fields in general
sorry, originally said "post edit", that's set on pages
Justin Sternberg
@jtsternberg
So add_group_field will just be a shim?
PG Lewis
@pglewis
not really sure where it lands after the dust settles
Justin Sternberg
@jtsternberg
Fair enough
PG Lewis
@pglewis
it wasn't really until after I had gotten the nesting part to work that I even realized... hey, I don't need add_group_field at all
a couple new helper functions could probably make it smoother and aid the OOP frightened
PG Lewis
@pglewis
if I do sell you on this restructure, or something like it, we might be able to maintain the divergent branches via TDD
if you write tests that fail for what you're doing, then write code that passes, then push the tests
I can write code on the divergent branch that passes tests, in case that's easier than merging