I have a module that provides an input filter for Drupal 6 and 7. It renders some elements using a (heavy) JavaScript module that I don’t want to include on every page.
In Drupal 6 the input filter would run and if a element that needed rendering was present the JavaScript files were added using the drupal_add_js(...)
method in the process step of the input filter. This works fine.
In Drupal 7 however, drupal_add_js(...)
is only executed when I clear the cache. Otherwise the page is rendered but the JavaScript files aren’t added. At first I thought that this was due to caching of the input filter. However I have set cache=>FALSE
for hook_filter_info()
and indeed $cache
is FALSE
in the process step.
Any suggestions how to fix this?