The following error occurs on Windows 7, IE 9: "SCRIPT5009: 'base64' is undefined" when using the imce upload for ckeditor.

Comments

mpp’s picture

We prefer to have the dependency to base64.js added to the module.

Also see https://www.drupal.org/node/1181070

mpp’s picture

Status: Active » Needs review
Anonymous’s picture

Does IE9 not work with <!--[if IE]> tag? I am not sure if we want to include a whole Javascript library just for IE... and if we are going to do it, it should be done through the library API.

mpp’s picture

The problem here is that rc4_email_preprocess_html() is not always excecuted (e.g. for the imce popup). This in turn results in a JavaScript error on IE browsers as it doesn't find the base64 dependency.

So I would either do a check on Drupal.settings.rc4_email if it is set before performing any actions:

if (Drupal.settings.rc4_email !== undefined) {}

Or implement hook_libraries_info to provide base64 as a library as some projects may not want to have a dependency to an external resource.

mpp’s picture

New patch with test if Drupal.settings.rc4_email is set.

damienmckenna’s picture

StatusFileSize
new1.62 KB

This uses the more correct typeOf varname !== 'undefined' structure.

damienmckenna’s picture

StatusFileSize
new2.13 KB

Whoops, I misspelled "typeof".

Anonymous’s picture

I haven't got around to test it yet but may I ask this: is that all it needed was to patch the js with typeof rc4_email !== undefined? If so please rtbc this and I'll commit the patch straight away. Thanks.

mpp’s picture

Status: Needs review » Reviewed & tested by the community

Indeed

  • sunnz committed a1f5d76 on 7.x-1.x authored by mpp
    Issue #2412933 by mpp, DamienMcKenna: Fixed Javascript error with...
Anonymous’s picture

Status: Reviewed & tested by the community » Fixed

Patch committed, thanks @mmp and @DamienMcKenna!

Status: Fixed » Closed (fixed)

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