eire123 / pwm

Automatically exported from code.google.com/p/pwm
0 stars 0 forks source link

dojo/ dijit HTML editor does not save data when edited via source #367

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Open up the Configuration Manager
2. Go to Settings -> Email
3. Click on the HTML body of an Email template, the Dojo/ dijit HTML editor 
pops up
4. Press the "view HTML source" button
5. Add some text and/ or valid HTML tags
6. Press ok

What is the expected output? What do you see instead?
I would expect that my edits would be stored by the editor. Instead all edits 
are not stored when done via the "View HTML source".

I dived into the documentation of Dojo/ dijit ViewSource plugin and it states 
that readOnly is false by default. This is the case for the PWM implementation 
(readOnly property is not set for the editor instances). As an extra check I 
edited configeditor.js to explicitly set the readOnly property of the 
ViewSource plugin to false:

diff configeditor.js.edit configeditor.js.original
1819c1819
<                 extraPlugins: [AlwaysShowToolbar, 
{name:"viewsource",readOnly:false},{name:"dijit/_editor/plugins/LinkDialog",comm
and:"createLink",urlRegExp:".*"},"fontName","foreColor"],

---
>                 extraPlugins: 
[AlwaysShowToolbar,"viewsource",{name:"dijit/_editor/plugins/LinkDialog",command
:"createLink",urlRegExp:".*"},"fontName","foreColor"],

However this makes no difference: all edits are not stored when done via the 
"View HTML source".

What version of PWM are you using?
Daily build (pwmVersion="1.7.0" pwmBuild="1216" pwmBuildType="RC1"  
createTime="2013-04-04 06:24:31 +0000") 

Original issue reported on code.google.com by sebastia...@gmail.com on 17 Apr 2013 at 6:26

GoogleCodeExporter commented 9 years ago
Just come across the same issue.

If you remove all the other plugins from the editor on line 1769 in 
configmanager.js you can make it work. Still not sure what the issue is at this 
stage.

change:

                extraPlugins: [AlwaysShowToolbar,{name:"dijit/_editor/plugins/LinkDialog",command:"createLink",urlRegExp:".*"},"fontName","foreColor","viewsource"],

to:
                extraPlugins: ["viewsource"],

Original comment by ro...@truscott.net.au on 6 May 2013 at 11:06

GoogleCodeExporter commented 9 years ago
Thanks for sharing your findings. My workaround was more hackish: use Firebug 
to copy the HTML inside the HTML div and save the configuration 8-)

I'll try to debug this further, it am not sure whether this is a bug of PWM or 
DOJO/ Dijit HTML editor.

Original comment by sebastia...@gmail.com on 6 May 2013 at 5:53

GoogleCodeExporter commented 9 years ago
I removed the extraPlugins one by one and found a problematic plugin 
interaction that is described here: 
http://bugs.dojotoolkit.org/ticket/16192

If you remove AlwaysShowToolbar from the extraPlugins, viewSource is working 
again.

This ticket can be closed, as this is a bug in the plugins of the Dijit editor, 
not in PWM itself.

Original comment by sebastia...@gmail.com on 7 May 2013 at 1:44