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
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
Justin Sternberg
@jtsternberg
The way you're doing it, It's a lot easier to see how the tests are migrating
PG Lewis
@pglewis
I see some updates to trunk
Justin Sternberg
@jtsternberg
yessir, a few
PG Lewis
@pglewis
I'd like to take a few minutes to talk about how we want to move forward before tomorrow afternoon, if possible
friend's bachelor party tomorrow evening so I'll likely be switching gears from code-focus to whiskey focus for a night
Justin Sternberg
@jtsternberg
ok, let's talk
PG Lewis
@pglewis
what are your thoughts on the current refactor? Is this something we could consider continuing that direction?
Justin Sternberg
@jtsternberg
yah, so far so good, though we still have to get add_field_group working, right?
PG Lewis
@pglewis
add_field_group?
Justin Sternberg
@jtsternberg
or add_group_field.. whatever lol
PG Lewis
@pglewis
add_group_field should be working except for saving and/or loading
the only thing broken with groups in general afaik
display should be working
all other tests, and the metabox examples in the example functions should /display/ right, or close to right
minus what I haven't quite tracked down yet with the field array -> field objects conversion
group saving may need some hammering with the new data structure yet, I just haven't gotten that far yet
I'm not personally using add_group_field in my nesting example, but that doesn't mean I pulled it out or that it doesn't work
just wasn't a necessary thing to do the nesting since add_field() now works splendidly with group fields as well as a metabox
PG Lewis
@pglewis
but if you setup the example functions in the repo, you should see the group field on a page like always
via add_group_field
just won't load/save
and I haven't really put any focus into the load/save yet because I was still cleaning up tests
iow: that was expected
since the refactor made it this far and is as close as it is to passing tests, I'm confident the back-compat part is doable
Justin Sternberg
@jtsternberg
Hmm I switched to your branch and my test group metabox disappeared entirely
PG Lewis
@pglewis
are you using the example from the repo?
Justin Sternberg
@jtsternberg
For the most part
PG Lewis
@pglewis
if it's a different test metabox than what I was testing I'd have to look at it and see