roundcube / roundcubemail

The Roundcube Webmail suite
https://roundcube.net
GNU General Public License v3.0
5.91k stars 1.64k forks source link

Signature JS error: dom is null or not an object #1731

Closed rcubetrac closed 16 years ago

rcubetrac commented 16 years ago

Reported by corradofiore on 28 Aug 2008 23:39 UTC as Trac ticket #1485304

Under IE7 with signature and HTML composition enabled, IE7 reports a JS error:

line: 2028 charachter: 9 error: 'dom' is null or not an object

Also, no signature gets added to the message.

Keywords: js javascript error dom null object ie7 Migrated-From: http://trac.roundcube.net/ticket/1485304

rcubetrac commented 16 years ago

Comment by @alecpl on 29 Aug 2008 06:50 UTC

Works for me, please verify with 53bd8fae.

rcubetrac commented 16 years ago

Status changed by @alecpl on 29 Aug 2008 06:50 UTC

new => closed

rcubetrac commented 16 years ago

Comment by corradofiore on 31 Aug 2008 14:33 UTC

Hi, I tried e7f85bd2 and found the following results:

  1. On IE version 7.0.6.6001.18000IC under Windows Vista works fine - no errors;
  2. On a slightly earlier release of IE (7.0.6000.16711) under Windows Vista the same JS error still occurs;

I will try on a PC with Windows XP and let you know.

rcubetrac commented 16 years ago

Comment by corradofiore on 1 Sep 2008 12:18 UTC

Also occurs on IE version 7.0.5730.13 under Windows XP. Using Microsoft JS debugger, I could see which line triggers the error:

-- on /program/js/app.js line 2076:

// Append the signature as a div within the body var sigElem = editor.dom.get("_rc_sig");

rcubetrac commented 16 years ago

Comment by @alecpl on 7 Sep 2008 18:02 UTC

Bug confirmed. Editor is not initialized when change_identity() from init_messageform(). So, JS error occurs and signature is not added.

rcubetrac commented 16 years ago

Status changed by @alecpl on 7 Sep 2008 18:02 UTC

closed => reopened

rcubetrac commented 16 years ago

Comment by tensor1982 on 13 Sep 2008 17:06 UTC

Works perfectly in FF 3.0.1 and Opera 9.52. Does not work in IE7.

Windows XP SP3, fully patched.

rcubetrac commented 16 years ago

Comment by tensor1982 on 13 Sep 2008 18:04 UTC

This bug is very subtle. I stepped through JS code in Visual Studio 2005 several times. On one occasion, the signature appeared, very weird.

rcubetrac commented 16 years ago

Comment by tensor1982 on 13 Sep 2008 20:52 UTC

Found the root cause of the problem. Variable editor for "compose-body" is not initialized because tinyMCE postpones its real initialization on Windows (and webkit based browsers). To fix this bug tinyMCE must be patched to provide callback when tinyMCE really transfors textareas into editor objects.

rcubetrac commented 16 years ago

Comment by tensor1982 on 13 Sep 2008 21:25 UTC

There is a callback for individual editors! See the patch, this should fix the problem.

In the light of editor callbacks, is it possible to get rid of call_init()? It introduces a noticable delay...

rcubetrac commented 16 years ago

Comment by tensor on 19 Sep 2008 19:28 UTC

My patch (ie_html_signature_no_call_init.patch) breaks printing in Opera because call_init() is stipped of and init() is called directly. window.print() does not work in opera until .onload is fired.

The proposed change is to signal to app object that two phases have been done:

  1. DOM is available
  2. Images have loaded (onload fired).
rcubetrac commented 16 years ago

Comment by rosali on 27 Oct 2008 10:29 UTC

rcubetrac commented 16 years ago

Comment by @alecpl on 5 Nov 2008 10:22 UTC

Fixed in d7a5bfac. Patch's part for call_init not applied because it was causing many new issues. If you still want to get rid of call_init prepare better patch and open new ticket.

rcubetrac commented 16 years ago

Status changed by @alecpl on 5 Nov 2008 10:22 UTC

reopened => closed