Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Provide a replacement for form_load_include().
Proposed resolution
Remaining tasks
User interface changes
API changes
form_load_include()
replaced with FormStateInterface::loadInclude()
Comment | File | Size | Author |
---|---|---|---|
#16 | 2328785-16.patch | 626 bytes | andypost |
#12 | form-2328785-11.patch | 11.11 KB | tim.plunkett |
Comments
Comment #1
tim.plunkettHere are two patches. I'd prefer to remove the function now, but I'm not sure what the current preferred approach is.
Comment #2
tim.plunkettHere it is with fully unit tests.
Comment #3
dawehnerpublic function loadInclude($module, $type, $name = NULL); just use the module handler
<3 *I see what you did here!
Comment #4
tim.plunkettWow, I had no idea that module_load_include was replaced like that.
But this is FormState, we can't inject into it. I guess I'll just keep wrap the moduleHandler? :\
Comment #5
tim.plunkettMeh.
Comment #7
tim.plunkettInterdiff against #2.
Comment #8
jibranI'd suggest we should use dataProvider here for DRY code.
Comment #9
tim.plunkettI started with a data provider, but it resulted in very very complicated test method, more than 6 parameters, and only 4 cases.
So I decided that 4 test methods was much clearer to read.
I noticed a bad indent, just fixing that.
Comment #10
jibranOk then.
Comment #11
tim.plunkettRerolled after #2328777: Refactor FAPI getCache()/setCache() into a standalone class
Comment #12
tim.plunkettComment #13
webchickCommitted and pushed to 8.x. Thanks!
Comment #15
andypostThis needs more work, probably in follow-up,
There's no change record
The example code is wrong!
The usage is confusing too...
Comment #16
andypostFix docs
Comment #17
andypostUpdated https://www.drupal.org/node/2121003
Comment #18
tim.plunkettThanks @andypost!
Comment #19
webchickOops. This fell off my radar.
Committed and pushed to 8.x. Thanks!