Coming from #1679594: node_requirements() breaks Drupal installer
Problem
The node module currently implements hook_requirements() in node.module.
Hook_requirements() documentation states:
Note that this hook, like all others dealing with installation and updates, must reside in a module_name.install file, or it will not properly abort the installation of the module if a critical requirement is missing.
Solution
Move node_requirements() from node.module to node.install.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | drupal-move_hook_requirements_install-2106783-6.patch | 3.26 KB | bneil |
| #1 | drupal-move_hook_requirements_install-2106783-1.patch | 3.43 KB | bneil |
Comments
Comment #1
bneil commentedComment #2
bneil commentedComment #3
kscheirerLooks good to me, yay for living up to our documentation!
Comment #4
alexpottCommitted 49689cf and pushed to 8.x. Thanks!
Comment #5
bneil commentedComment #6
bneil commentedHere's a patch against 7.x. I don't believe $t = get_t() is necessary since this is a runtime phase requirement.
Comment #7
sivaji_ganesh_jojodae commentedPatch looks good to me. Able to apply without any issues. +1 for changing it to RTBC.
Comment #8
sivaji_ganesh_jojodae commentedComment #9
parthipanramesh commentedThe latest patch works fine for me. Thanks! :)
Comment #10
parthipanramesh commentedComment #11
David_Rothstein commentedSince the Node module is required in Drupal 7 (and even if it isn't, node_requirements() has no install-time checks anyway) there is no practical benefit to moving it. And since it's (sort of theoretically) a public API function that someone could be calling, I think it's best to just leave this where it is in Drupal 7.