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.
views_form()
is the only form that still depends on hook_forms() in core, because it is still a function. By converting it to a class, we can fix #2110951: Remove hook_forms().
Comment | File | Size | Author |
---|---|---|---|
#14 | interdiff.txt | 839 bytes | dawehner |
#14 | vdc-2110953-14.patch | 18.72 KB | dawehner |
#12 | vdc-2110953-12.patch | 18.7 KB | dawehner |
#12 | interdiff.txt | 909 bytes | dawehner |
#8 | vdc-2110953-8.patch | 18.59 KB | dawehner |
Comments
Comment #1
dawehnerLet's see how this works out.
Comment #2
XanoI know this is a 1:1 copy-paste from the function docblock, but IMHO we should change this. It's even worse for the class than it was for the function.
Needs docblock.
Needs docblock.
Undocumented properties.
Undocumented properties.
We should use a more descriptive name than $form_arg.
Comment #3
XanoComment #4
dawehnerSome absolute documentation on there would be kind of cool
I like the new variable name.
Comment #5
XanoComment #6
XanoWhoops, let me fix those files.
Comment #7
XanoComment #8
dawehnerMade some little changes given that I don't really want to RTBC my own patch.
Comment #9
XanoIt's a beauty!
Comment #10
damiankloip CreditAttribution: damiankloip commentedSorry, if we are creating an instance ourselves here, I think we should be creating a new object (new > __construct) instead of using the static create() method.
Comment #11
alexpottNeeds work due to #10
Comment #12
dawehner.
Comment #13
tim.plunkettThis seems wrong to me.
But I guess we need it here...
Ouch, it hurts to have this duplicated again
Why not the ::create here?
FormBuilder!
Comment #14
dawehnerSee https://drupal.org/node/2110953#comment-7984973
Fixed
Comment #15
damiankloip CreditAttribution: damiankloip commentedughs, we didn't convert that either. I will file a follow up. That got missed in the epic camalization patches.
Patch looks ready though.
Comment #16
damiankloip CreditAttribution: damiankloip commentedRelated, from #15 comment: #2123843: Camelize views form methods
Comment #17
Xano14: vdc-2110953-14.patch queued for re-testing.
Comment #18
webchickI checked w/ Tim on whether or not we needed to retain legacy wrappers on these functions, but he said that these are all internal-facing Views things, so this looks like a nice clean-up (and one that other modules might be able to use for general wizards with a little tweaking). Tagging as an approved API change.
I'll confess I don't follow all of this code, but in comparing/contrasting the procedural vs. OO hunks, this seems to be basically doing the same thing.
Committed and pushed to 8.x, with some minor docs massaging on the ViewsForm class for the docs gate.
Comment #19
hansfn CreditAttribution: hansfn commentedAs the maintainer of Views Send, a Views Form implementation, I would very much like a change record for this issue because: 1) It took me quite some time to find this issue and 2) it isn't very clear how you should implement a Views Form now. Thx for any help in making my module work again.
Added some hours later: I was able to make my module work again, but I'm not sure if I did it the right way.
Comment #20
dawehnerComment #21
xjmLooks like we missed moving this to Views for the change record. :)
Comment #22
Chris Matthews CreditAttribution: Chris Matthews as a volunteer and at City of Oaks Design commentedFor more information as to why this issue was moved to the Drupal core project, please see issue #3030347: Plan to clean process issue queue
Comment #23
Chris Matthews CreditAttribution: Chris Matthews as a volunteer and at City of Oaks Design commentedMoving back to the contributed Views issue queue and closing as outdated per https://www.drupal.org/project/views/issues/3030347#comment-13023447