Closed (duplicate)
Project:
Drupal core
Version:
8.0.x-dev
Component:
node system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
31 Dec 2011 at 16:45 UTC
Updated:
15 Sep 2014 at 15:12 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
bleen commentedThere is actually a TODO in the node_form() function to get rid of hook_form ... I feel like that would be even more useful than renaming it
Comment #2
joachim commentedIt's a magic callback rather than a true hook, so I suppose the simplest way to fix this would be to require the callback to be declared in hook_node_info().
Though, are node types getting converted to plugins?
Comment #3
bleen commentedAttached is a first pass at killing hook_form ... I'm sure testbot will gripe about the node_content_form() function in node.module but I'm at a good testing point.
Testbot, please do your thing...
Comment #4
bleen commentedre #2: there is a desire to kill hook_node_info() as well: #1376884: Use configuration for entity types
Comment #6
bleen commentedI think this solves the main gripes ... but there will still be many remaining.
Comment #8
joachim commentedI think doing this with an alter hook is the right way. It feels like weaker DX. hook_form() feels like you, the node type providing module is *making* the form. Going to a mere form alter hook feels a bit uncomfortable.
Comment #9
bleen commentedand now we see about fixing these poll issues by naming the function poll_form_node_form_alter instead of forum_form_node_form_alter ... Oh cut & paste
Comment #10
bleen commentedre#8: Hmmmm ... my thought is that this should be no different a process than any other form that you are manipulating with a module. In my mind this adds a level of consistency.
It sounds like we could do with a few more opinions. Ill see what I can drum up in IRC
Comment #11
bleen commentedDoh! Swentel just pointed out that I uploaded the wrong patch in #9. This is the correct one
Comment #13
bleen commentedThis removes a bit more code from node.pages.inc and it should fix the simpletest fail... though admittedly I'm not sure why the shortcut test was failing in the first place - hmmmm
Comment #15
joachim commentedThe hook_form_alter way is going to cause problems with contrib modules that want to alter the forms of particular node types.
I think that a node type module needs to be lower down and to have a conceptual responsibility for the form.
Comment #16
bleen commentedI see your point in #15, but I still think this can be a viable solution. Ill marinate some more on it
In the mean time this patch should pass tests ...
Comment #17
bleen commentedfriggety frak!!! I did it again
Comment #20
alansaviolobo commentedComment #21
tim.plunkettDuplicate of #2018375: Get rid of node_hook and node_invoke