4

I wrote a feature module that contains content types and test nodes. After importing those nodes, a certain cache has to be rebuild.

Both hooks I know (hook_install() and hook_enable()) are called before the import happens.
Is there any hook that is executed only once after the feature import is done?

2 Answers 2

3

It depends on how the nodes are imported really. You should be able to use hook_modules_enabled which is the last hook invoked when a module is installed and enabled. You might need to tweak your module weight to make sure it's invoked after the import of the nodes.

2
  • Thanks that worked - however the hook is called modules_enabled
    – jantimon
    May 3, 2011 at 12:05
  • @Ghrommey, thanks, I don't know how I managed to get the link right but the name wrong.
    – googletorp
    May 3, 2011 at 14:51
1

As of Features 7.x-2.x-something, there are new hooks available which should help here. There are now pre/post enable/disable/revert/rebuild hooks, see for example here.

In @jantimon’s scenario, implementing hook_post_features_enable_feature($component) would do the trick.

Your Answer

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

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