Drupal doesn't invoke a hook function until I don't clean the cache
The reason why clearing the caches fixed the issue is because all hooks are cached in Drupal 7 via module_implements(). My guess is something odd happened to your cache and thus your hook went missing from the cache.