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

CommentFileSizeAuthor
wysiwyg6.x-1.0-none-js-fix.patch439 bytesjfduchesneau

Comments

sun’s picture

Status: Needs review » Closed (won't fix)

If 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.

jfduchesneau’s picture

I 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.

sun’s picture

Status: Closed (won't fix) » Needs review

You 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.

sun’s picture

Status: Needs review » Fixed

Although 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.

jfduchesneau’s picture

Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.