0

I am using the Rules module and the event "Drupal is initializing" in a rule to check if a user has clicked their confirmation link in their email that Drupal has sent them to verify their account. This rule is called with every page load several times.

Should this be? And Is there a way to accomplish this without the need for firing this rule?

  • "Drupal is initializing" is generated in hook_init(). As stated in the core drupal documentation, this hook is run at the beginning of the page request. So if you are seeing this event twice, then you must have more than one hook_init() implementation on your system. Check for contributed modules which may also generate an event in hook_init(). – anonymous Nov 11 at 8:07
  • Thank you. Do you also know if each of these hook runs put considerable load on the site? And should one try to avoid these hook_init() to run multiple times? – BassPlaya Nov 12 at 12:17
  • 1
    Drupal core runs thousands of hooks every page load. A few lines of code in one hook isn't going to make a measurable difference. – anonymous Nov 13 at 21:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.