Fix populator bug causing new data to never be set.#198
Fix populator bug causing new data to never be set.#198undergroundwebdesigns wants to merge 6 commits intotrailblazer:masterfrom
Conversation
|
Note: I also dropped the "setter" lines from the |
|
The input values in the nested fragment are set after the populator. The latter creates/finds the nested object, appends it to the parent object (and you're right, I am confused now, too, about why you could simply remove that block), and then calls |
|
Well, if we're both confused, maybe some more research is needed into what's going on here? I can confirm the above fix works, we've been using it in production on a rather large app for a couple months now... |
|
Thanks Alex, I am about to dive into making Reform's and Representable's populators do the same thing, I'll let you know about my findings. Thanks for pointing this out!!! |
Currently, the populator is coded to remove the
SetValueoperation from the pipeline, and in my testing this means that the populator runs and returns the correct record (e.g. via the "find or instantiate" logic), but then new values from the are never set on that record.In my testing, simply dropping this line makes everything work as expected.
I do see that
Representable::FindOrInstantiateis coded to set it's resultobjecton the represented object directly, so maybe I'm misunderstanding something about how populators are supposed to work? As currently coded, how are theinputvalues ever going to be set on the populatedobject?