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.
API page: http://api.drupal.org/api/drupal/modules--node--node.api.php/function/ho...
All hooks are supposed to have function bodies. This one doesn't. The sample could come from two core implementations of this hook (possibly simplified)... probably a good Novice project?
Comment | File | Size | Author |
---|---|---|---|
#12 | hook_node_type_insert-doc-v3.patch | 473 bytes | marvil07 |
#8 | hook_node_type_insert-doc.patch | 457 bytes | marvil07 |
#6 | hook_node_type_insert-doc.patch | 550 bytes | marvil07 |
#3 | drupal-add-function-body-1354852-3.patch | 547 bytes | 30equals |
Comments
Comment #1
Sree CreditAttribution: Sree commentedI am open to update this & provide the patch
Comment #2
xjmHi @Sree,
Thanks for taking this on. Are you still working on this issue? If not, we'll unassign it in a day or two so that someone else can give it a try. (Feel free to assign it back to yourself if you'd still like to work on it, as well.) Thanks!
Comment #3
30equals CreditAttribution: 30equals commentedHi there,
I came across this issue, and thought i'd supply a basic batch. I added a simple function body to illustrate the hook.
I hope it's sufficient like this :)
Comment #4
marvil07 CreditAttribution: marvil07 commentedPatch looks good, it's a simple example and it does not really need any extra comments since the output message explain it.
I would say it's ok.
Comment #5
tim.plunkettShouldn't this be in t()?
-22 days to next Drupal core point release.
Comment #6
marvil07 CreditAttribution: marvil07 commentedComment #7
jhodgdonUm... This is for hook_node_type_insert(), not hook_node_type_update(), right? In which case, I don't think there is an "old type"?
Comment #8
marvil07 CreditAttribution: marvil07 commentedI need to pay more attention :-p
Comment #9
jhodgdonThat's better. :) It's not a very useful sample function body, but I guess it gets the point across.
Comment #10
Dries CreditAttribution: Dries commentedIt is a bit confusing that the machine name is $type but I'm okay with this example.
Comment #11
jhodgdonWell, that is what the content type object's field name is... I think the example is clear enough, since it says "with machine name %type", but it would be easy enough to change it to %machine_name, which would definitely get rid of all confusion...
Comment #12
marvil07 CreditAttribution: marvil07 commentedComment #13
jhodgdonRTBC again, thanks! :)
Comment #14
Dries CreditAttribution: Dries commentedCommitted to 7.x and 8.x. Thanks!
Comment #15
marvil07 CreditAttribution: marvil07 commentedIt seems like the patch included on both 7.x and 8.x was the one on comment 8(not the one on comment 12).
Was it a mistake? If so, please re-close again.
Comment #16
Dries CreditAttribution: Dries commentedThis was on purpose. Sorry for not being more clear.
Comment #17
xjmSo what was the reasoning for using #8 instead of #12?