First Last Prev Next    No search results available
Details
: Reply template is broken in version 1.3+
Bug#: 26276
: smarttemplate4
: General
Status: RESOLVED
Resolution: DUPLICATE of bug 26261
: PC
: Windows NT
: unspecified
: P2
: normal
: ---

:
:
:
:
:
  Show dependency tree - Show dependency graph
People
Reporter: Vitaly Zaitsev <vitaly@easycoding.org>
Assigned To: Axel Grude <axel.grude@gmail.com>
:

Attachments
1.3.1 prerelease 8 (380.92 KB, application/x-xpinstall)
2016-09-12 11:09, Axel Grude
no flags Details


Note

You need to log in before you can comment on or make changes to this bug.

Related actions


Description:   Opened: 2016-08-21 11:37
Reply template is not working in version 1.3+. Under 1.2.x it works fine.
------- Comment #1 From Axel Grude 2016-08-22 02:37:50 -------
PLease provide the following info:

0. Are you replying in HTML or plain text?

1. Your Quote header

2. Your Template

3. Settings:
[x] Use instead of default quote header
[x] Use HTML
[ ] Replace line breaks with <br>

4. Global Settings:
[x] Replace SIgnature
[x] Process Signature
[x] Replace line breaks in plain text sig

[x] Force Paragraph Mode


You can use JavaScript Error console (CTRL+SHIFT+J) to see if any new errors
are reported during opening the composer window.
------- Comment #2 From Vitaly Zaitsev 2016-08-22 05:03:23 -------
> 0. Are you replying in HTML or plain text?

Plain text.

> 1. Your Quote header

Hello, %from(name)%.

%date% you wrote:

> [x] Use instead of default quote header

Checked.

> [x] Use HTML

I'm not using HTML messages at all. Checked for test. Same.

> 4. Global Settings:
> [x] Replace SIgnature
> [x] Process Signature
> [x] Replace line breaks in plain text sig

All three checked.

> [x] Force Paragraph Mode

Checked.

> You can use JavaScript Error console (CTRL+SHIFT+J) to see if any new errors

No erros, just messages:

Mon Aug 22 2016 15:00:36 GMT+0300 CH: messagePaneBoxFocus start
Mon Aug 22 2016 15:00:36 GMT+0300 CH: messagePaneBoxFocus stop
------- Comment #3 From Axel Grude 2016-08-22 07:31:53 -------
(In reply to comment #2)
> > 0. Are you replying in HTML or plain text?
> 
> Plain text.
> 
> > 1. Your Quote header
> 
> Hello, %from(name)%.
> 
> %date% you wrote:
> 

For testing I am going to assume what you are doing is this:

1 - Quote Header:
%date% you wrote:

2 - Template:
Hello, %from(name)%.

===
...because that's what each part is. quote header is basically whats _always on
top_ of the quote block

The Template represents your "writing area" - basically its the stationery that
you write on. Whether this is before or after the quote depends on account
settings > Composition and Addressing


Now I tested with 2 settings

"start my reply above the quote"
and
"start my reply below the quote"

which both worked for me. When the email is created the cursor is dropped
straight below the "Hello, name."

What are you getting in your new email, any words at all? Only the quoted
email? or just things appearing in the wrong / unexpected space? Note that the
two words "Is broken" doesn't really help me to get a picture of what is
happening. It could mean that composer is not loading at all, or that
everything is perfect except for the name being replaced or an infinite other
possible results. If you like, attach the text of a generated email replying to
a simple test message _without editing it_ straight after composer shows it.
------- Comment #4 From Vitaly Zaitsev 2016-08-22 07:45:15 -------
> What are you getting in your new email, any words at all? Only the quoted
email?

I see only quoted text in new Email window. No quote header at all.

> It could mean that composer is not loading at all, or that
everything is perfect except for the name being replaced or an infinite other
possible results. If you like, attach the text of a generated email replying to
a simple test message _without editing it_ straight after composer shows it.

http://paste.fedoraproject.org/412485/18770841/
------- Comment #5 From Vitaly Zaitsev 2016-08-22 07:47:22 -------
Same templates but on SmartTemplate version 1.2.1:
http://paste.fedoraproject.org/412490/18771971/
------- Comment #6 From PeterM 2016-09-09 05:03:26 -------
I'm experiencing the same problem. When I reply in plain text mode (my
default), the problem occurs. When I reply in HTML mode (with Shift + Reply
button) it works.

I debugged the code and found that in Reply mode you look for BLOCKQUOTE tag.
This tag doesn't exist in a plain text reply message, only in HTML reply
message.

So I replaced the code in smartTemplate-compose.js:
let firstQuote =                                           
  (composeCase=='forward') ?                               
        editor.rootElement.firstChild :                          
  editor.rootElement.getElementsByTagName('BLOCKQUOTE')[0];

with:
let firstQuote =                                           
  (composeCase=='forward') ?                               
        editor.rootElement.firstChild :                          
  (editor.rootElement.getElementsByTagName('BLOCKQUOTE')[0] ?
editor.rootElement.getElementsByTagName('BLOCKQUOTE')[0] :
editor.rootElement.firstChild);

and it works.
------- Comment #7 From Axel Grude 2016-09-09 06:40:03 -------
(In reply to comment #6)
> I'm experiencing the same problem. When I reply in plain text mode (my
> default), the problem occurs. When I reply in HTML mode (with Shift + Reply
> button) it works.
> 
> I debugged the code and found that in Reply mode you look for BLOCKQUOTE tag.
> This tag doesn't exist in a plain text reply message, only in HTML reply
> message.
> 
> So I replaced the code in smartTemplate-compose.js:
> let firstQuote =                                           
>   (composeCase=='forward') ?                               
>         editor.rootElement.firstChild :                          
>   editor.rootElement.getElementsByTagName('BLOCKQUOTE')[0];
> 
> with:
> let firstQuote =                                           
>   (composeCase=='forward') ?                               
>         editor.rootElement.firstChild :                          
>   (editor.rootElement.getElementsByTagName('BLOCKQUOTE')[0] ?
> editor.rootElement.getElementsByTagName('BLOCKQUOTE')[0] :
> editor.rootElement.firstChild);
> 
> and it works.
> 

Thanks for doing the leg work.  I am out over the weekend but will review the
code when I am back home. Hope using firstchild is sufficient for all
positioning cases.
------- Comment #8 From Axel Grude 2016-09-12 11:07:15 -------
(In reply to comment #7)
> (In reply to comment #6)
> > I'm experiencing the same problem. When I reply in plain text mode (my
> > default), the problem occurs. When I reply in HTML mode (with Shift + Reply
> > button) it works.
> > 
> > I debugged the code and found that in Reply mode you look for BLOCKQUOTE tag.
> > This tag doesn't exist in a plain text reply message, only in HTML reply
> > message.
> > 
> > So I replaced the code in smartTemplate-compose.js:
> > let firstQuote =                                           
> >   (composeCase=='forward') ?                               
> >         editor.rootElement.firstChild :                          
> >   editor.rootElement.getElementsByTagName('BLOCKQUOTE')[0];
> > 
> > with:
> > let firstQuote =                                           
> >   (composeCase=='forward') ?                               
> >         editor.rootElement.firstChild :                          
> >   (editor.rootElement.getElementsByTagName('BLOCKQUOTE')[0] ?
> > editor.rootElement.getElementsByTagName('BLOCKQUOTE')[0] :
> > editor.rootElement.firstChild);
> > 
> > and it works.
> > 
> 
> Thanks for doing the leg work.  I am out over the weekend but will review the
> code when I am back home. Hope using firstchild is sufficient for all
> positioning cases.
> 
hmm, just checked my source code it is starting from line 1004:

let firstQuote = 
  (composeCase=='forward') ?
  editor.rootElement.firstChild :
  editor.rootElement.getElementsByTagName('BLOCKQUOTE')[0];

if (!firstQuote) firstQuote = editor.rootElement.firstChild;

but may be related to [Bug 26261]. Posting a patch here next
------- Comment #9 From Axel Grude 2016-09-12 11:08:22 -------

*** This bug has been marked as a duplicate of bug 26261 ***
------- Comment #10 From Axel Grude 2016-09-12 11:09:54 -------
Created an attachment (id=8232) [details]
1.3.1 prerelease 8

fallback for p[lain text case

First Last Prev Next    No search results available