2

I have found only few hooks that can be used in the .install file. They are:

  • hook_enable
  • hook_disable
  • hook_install
  • hook_uninstall
  • hook_requirements
  • hook_update_N
  • hook_schema
  • hook_schema_alter
  • hook_update_last_removed
  • hook_field_schema

Please tell me if I have left any hooks.

1

2 Answers 2

2

I think you are missing function

hook_field_schema

This hooks are mentioned in the "list" and "number" default module which is in "field" module.

1
  • you can give upvote as well.. :)
    – parth.k
    Jul 15, 2016 at 7:11
0

There is no official list of the hook which can only be used in .install file. But I can give you a hint how to find some of them.

You can try to search module_load_install in Drupal project. Some of the hook function is called immediately after calling this function.

This method can help to find out those hook functions which requires loading of the .install file. Not only for core, but also the functions provided by contrib modules .

enter image description here

3
  • It is a way to find other .install work only hook function provided by contrib module as well :)
    – Jimmy Ko
    Jul 15, 2016 at 8:38
  • For example , I had searched in module_filter module (sites/all/modules/module_filter.install) . but I didn't get the module_load_install inside the module_filter.install. Am i doing in a right way . if I did mistake means, please help me how to find that . Jul 15, 2016 at 13:29
  • @logeshvaran you should not search in .install file. module_load_install() is a function for Drupal to load the required .install file before implementing some of the hook functions. It is no point to find module_load_install() within .install file.
    – Jimmy Ko
    Jul 15, 2016 at 13:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.