#1488017 closed Bugs (fixed)

IE7: cannot add attachments

Reported by: arekm Owned by:
Priority: 5 Milestone: 0.6-beta
Component: Client Scripts Version: git-master
Severity: normal Keywords:
Cc: przemyslaw.plewa@…

Description

From colleague:

 In IE7 I can not add attachments  (JS error appears: "Obiekt nie obsługuje tej operacji" - [polish IE version] - means "Object doesn't support this operation").

Error occurs in Rcube_event_engine.prototype.triggerEvent  (line 356 "common.js file" [svn rev5004])

It seems that IE7 does not support the method "delete" for the HTMLFormElement objects  (but such object is passed to cube_event_engine.prototype.triggerEvent when you try to upload attachments).

For example, I created  a test
<html>
   <body>
     <form id='someid' name='somename'>
       <input type="button" value="test" onclick="
         this.form.event = 'test';
         delete this.form.event;
       "/>
     </form>
   </body>
</html>

In this case, IE7 returns the error: "Object does not support this operation" (Polish IE version).

I'm not an expert in JS, but had made a short patch which may prove to be helpful in solving the problem ...
Here it is:
# diff -ubB program/js/common.js program/js/common.my.js
--- program/js/common.js        2011-08-02 12:47:20.135410166 +0200
+++ program/js/common.my.js     2011-08-02 12:47:08.289738141 +0200
@@ -353,7 +353,14 @@
   }

   this._event_exec = false;
+  try {
   delete e.event;
+  } catch (err) {
+       //IE7 doesn't support "delete" method on HTMLFormElement objects
+       if(document.forms[e.name].event == e.event ) {
+               $(e).removeAttr('event');
+       }
+  }

   return ret;
 }



Change History (2)

comment:1 Changed 22 months ago by pepe000

  • Cc przemyslaw.plewa@… added

comment:2 Changed 22 months ago by alec

  • Component changed from Core functionality to Client Scripts
  • Milestone changed from later to 0.6-beta
  • Resolution set to fixed
  • Status changed from new to closed

Fixed in [6e16260e].

Note: See TracTickets for help on using tickets.