If Drupal.behaviors.textarea is not initialized, then none.js is broken.
The question is: how come Drupal.behaviors.textarea is not initialized? Well, for some reason, the core file misc/textarea.js was disabled in a site's installation, to prevent being able to resize text areas. It is this textarea.js file which initializes Drupal.behaviors.textarea. If Drupal.behaviors.textarea in no initialized, then none.js fails.
I've attached a small patch which fixes the problem by adding a check in none.js.
Thanks,
jf
| Comment | File | Size | Author |
|---|---|---|---|
| wysiwyg6.x-1.0-none-js-fix.patch | 439 bytes | jfduchesneau |
Comments
Comment #1
sunIf you hack Drupal core, you'll face all kind of unexpected issues.
Removing or renaming misc/textarea.js is not the proper way to disable resizable textareas. You would use a Form API #process function instead that runs in front of Drupal core's textarea processing.
Comment #2
jfduchesneau commentedI understand that modifying the core is not a good idea, and removing textarea.js is certainly not the best way to disable the text area resize. I agree with you.
However I had to enable the wysiwyg api module on a site which was already setup that way (with the textarea.js hack). I did not have the mandate to fix the core on that site. My patch was only about adding a bit of robustness to the wysiwyg api module, in case something is missing on the site's core.
Comment #3
sunYou convinced me. But, without looking at it closely, I think this patch does not catch all instances where none.js presumes textarea.js being loaded.
Needs review/analysis/testing.
Comment #4
sunAlthough I think the fix is wrong (none.js shouldn't really do anything of what it does if textareas are not resizable) I've committed this patch, because it's very unlikely that anyone will review/test it.
Thanks for reporting, reviewing, and testing! Committed to all branches.
A new development snapshot will be available within the next 12 hours. This improvement will be available in the next official release.
Comment #5
jfduchesneau commentedThanks!