hook_form_alter() only firing after cache clear I have a custom module that I'm using to add a Java applet to some of my admin forms. The applet is necessary to get details about the product being entered.

I'm noticing that after 15 minutes (or more) of site inactivity, my hook stops firing. If I clear the cache, the hook begins firing once again. However, this only seems to last 15 minutes or so.

Is it possible there is some admin form caching happening?

Possibly salient details:


I'm using Seven as the admin theme
I'm using D7 with Commerce Kickstart install profile (commerce_kickstart-7.x-1.8)
I think your problem stands in cascading caching logic : your form must be called by something (a block, a template, a function...) that must be itself cached.

What you have to think about is "When, and by who, is my cache warmed up, with which conditions ?" : the most logical answer is that when your cache is created for the first time, conditions in your hook_form_alterare not TRUE.

For example, are you searching, in your alter, for infos coming from the session, or user roles, or static variables...

We could do more with your code :)