From c3919c6dd9e7fd0e83cd4ca500f2abed7bab97c0 Mon Sep 17 00:00:00 2001 From: David Cook Date: Mon, 29 Jul 2013 13:02:26 +1000 Subject: [PATCH] Bug 10652 - Ajaxfileupload.js failing in IE9 for local image upload This patch adds a try/catch to the Javascript for adding the iframe element. The try will work for IE8 and older versions, while newer versions and other browsers will be covered by the check. Test Plan: 1) Try uploading a local cover image in IE9 2) Notice that your page is reloaded with no result (except the pop-up of a Javascript error, if you have error reporting on in your browser). 3) Apply the patch 4) Trying uploading a local cover image again 5) Notice that it uploads correctly 6) Repeat steps 4 and 5 for IE8, IE7, and/or other modern browsers. Signed-off-by: Owen Leonard Tested in IE10 in IE10 "browser mode" and IE9 mode as well as in Firefox. Uploads work correctly with book cover images and in MARC uploads. Signed-off-by: Kyle M Hall Also verified as working in Chrome. Signed-off-by: Tomas Cohen Arazi Doesn't break functionality and fixes a known problem. I'll push this for stable branches to use it, but will fill a new bug for updating AjaxFileUpload.js from upstream. Signed-off-by: Galen Charlton --- koha-tmpl/intranet-tmpl/lib/jquery/plugins/ajaxfileupload.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/lib/jquery/plugins/ajaxfileupload.js b/koha-tmpl/intranet-tmpl/lib/jquery/plugins/ajaxfileupload.js index 8bb2c17236..0e1d75b31c 100644 --- a/koha-tmpl/intranet-tmpl/lib/jquery/plugins/ajaxfileupload.js +++ b/koha-tmpl/intranet-tmpl/lib/jquery/plugins/ajaxfileupload.js @@ -6,7 +6,7 @@ jQuery.extend({ //create frame var frameId = 'jUploadFrame' + id; - if(window.ActiveXObject) { + try { var io = document.createElement('