Just tested #2537732: PluginFormInterface must have access to the complete $form_state (introduce SubFormState for embedded forms) with the Search API and after a bit of tweaking and cursing everything ran fine. Which is of course great news, moving all the complexity of that class to Core would be a nice improvement for us. (Also brings larger possibility to spot any lurking bugs.)
However, since I'd guess this won't make it into the lower-version brancher (not sure, though), the question would be how we would go about doing this. Wait a bit after the Core issues gets committed and the set a minimum Drupal version? Or is there a better way? (Leaving a BC layer in for the time being might also be an option, though a rather ugly one.)
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | 2690229-12--core_subformstate.patch | 30.42 KB | drunken monkey |
Comments
Comment #2
drunken monkeyHere is the patch, in any case.
Comment #3
borisson_Let's try not to leave in a bc layer if we can help it, and I agree that using those classes would be great so we don't have to support that code ourselves. I'll try to help move along the other issue if possible.
Comment #4
drunken monkeyTagging so I don't forget this – also, I guess it's quite likely that 8.2.0 will be out when we create RC1.
Comment #5
borisson_Setting this back to active, as #2537732: PluginFormInterface must have access to the complete $form_state (introduce SubFormState for embedded forms) got committed a while ago.
Comment #6
drunken monkeyI'd still postpone this until 8.2.0 has been released, since we can't really commit it before then anyways.
Comment #7
borisson_8.2 got released!
Comment #9
borisson_Looks like this needs a reroll.
Comment #10
drunken monkeyI don't know off the top of my head, but if Core's sub-form states have some introspection, maybe that would also be a clean solution to use
#statesin plugins (for which we already have some@todocomments).Comment #11
drunken monkeyThis is the re-roll.
Comment #12
drunken monkeyAnd this also fixes the
#states, at least for the Highlight processor.The other instances were all in Views plugins, which apparently don't use sub-form states anyways.
Also, there is no introspection in Core's implementation, so that plan was off – but I discovered during the re-roll that we already set
#parentsbefore callingbuildConfigurationForm()(at least in the processors form), so that was easy to implement. Still used defensive coding in case that ever changes again.Comment #13
borisson_Comment #15
drunken monkeyLooks good, thanks a lot for reviewing!
Committed.