[ETHREEOH-2789] TinyMCE forcing root paragraph tag Created: 02-Sep-09  Updated: 10-Dec-09  Resolved: 12-Oct-09

Status: Closed
Project: Enterprise 3.x
Component/s: WCM
Affects Version/s: 3.1 SP1
Fix Version/s: 3.2
Security Level: external (External user)

Type: Bug Priority: Critical
Reporter: Viji Hariharan Assignee: Closed Bugs
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 2 hours
Time Spent: Not Specified
Original Estimate: 2 hours
Environment: 3.1.1 E, Windows, MySQL, Tomcat

Attachments: XML File web-client-config-wcm.xml    

In the version of TinyMCE that is in 3.1.1, the root tag is forced on the content even with force_root_block set to false.
This did not happen in 3.1 and earlier versions.

I am attaching the web-client-config-wcm.xml file that adds the HTML source editor control in the UI. Also, this happens in bot IE and FF

Comment by Mark Johnston [ 12-Sep-09 ]
We just encountered this bug at Openroad for one of our clients:

This may be useful information for someone at Alfresco as a starting point in investigating this issue.

A fix was been found that requires updating two files. Ultimately this needs to be packaged up as an AMP file.

1) ./tomcat/webapps/alfresco/WEB-INF/classes/alfresco/web-client-config-wcm.xml

Update web-client-config-wcm.xml to add this to all RichTextEditor configs: "xs:textarea"

<param name="forced_root_block">false</param>
<param name="remove_linebreaks">false</param>
<param name="force_br_newlines">true</param>
<param name="remove_trailing_nbsp">false</param>
<param name="verify_html">false</param>
<param name="force_p_newlines">false</param>

2) tomcat/webapps/alfresco/scripts/ajax/xforms.js

Edit xforms.js (in tomcat\webapps\alfresco\scripts\ajax)

In _createTinyMCE:function(), around line 881, comment out the if block, should be something like:

    for (var i in this._params)
    // if (i in tinyMCE.settings)
    // {
        alfresco.log("setting tinyMCE.settings[" + i + "] = " + this._params[i]);
        tinyMCE.settings[i] = this._params[i];
    // }

This was necessary because when stepping through what Alfresco is setting, not all of the <param>s above are set. My theory is that the tinyMCE.settings hash doesn't actually have all the settings, just a subset of non-default ones

This was tested in staging and appears to work. One thing to be aware of is that newline is entered in a Webform a <BR> is inserted into the text instead of a paragraph tag <P>
Comment by Mark Rogers [X] (Inactive) [ 07-Oct-09 ]
Assigning this to the UI Team. Surely TinyMCE is related to the UI?
Comment by Lawrence Carvalho [ 12-Oct-09 ]

I didn't implement the suggested fix as we want to keep the ability to override any settings. Instead fix involved setting 'forced_root_block : false' as a default setting for tinymce.
Comment by Steve Rigby [X] (Inactive) [ 27-Oct-09 ]
For retest.
Comment by Alfresco QA Team [ 20-Nov-09 ]
Successfully validated on Alfresco 3.2 EE build 248 Windows 2008 SP1 x64, Tomcat 6.0.18, Mysql 5.1.39, JDK 6u16 x64, Windows XP SP3, IE6
Comment by Gavin Cornwell [ 10-Dec-09 ]
Re-applied fix: https://issues.alfresco.com/jira/browse/CHK-10534
Generated at Mon Feb 18 07:09:44 GMT 2019 using JIRA 7.6.3#76005-sha1:8a4e38d34af948780dbf52044e7aafb13a7cae58.