Drupal: WYSIWYG/TinyMCE + JS Aggregation
A minor victory over a nagging issue: how to get the WYSIWYG module, and/or TinyMCE 3, to work with the Javascript aggregation module (in Drupal 5)/feature (in Drupal 6)? The initial consequence of JS aggregation on a page with a rich text field is this perfectly helpful message:
u is undefined
After attempting a few potential solutions that involved meddling in the wysiwyg.module code, I was able to get some results with this approach:
(Note how a simple hook, even if not being used for the original intended purpose, makes community development so much easier!)
In Drupal 5
Note the name of the $conf array key for JS aggregation, which is specific to the Drupal 5 Javascript Aggregator module.
function hook_wysiwyg_plugin() {
global $conf;
$conf['javascript_aggregator_aggregate_js'] = 0;
}
In Drupal 6
Note the name of the $conf array key for JS aggregation, which is specific to the Drupal 6 built-in Javascript aggregation feature:
function hook_wysiwyg_plugin() {
global $conf;
$conf['preprocess_js'] = 0;
}
YMMV, and I'm sure this will get fixed eventually, but not an awful fix for the time being.
- Login to post comments
Pete Stein