percussion / percussioncms

Percussion CMS - Content Management System
https://percussioncmshelp.intsof.com/percussioncms
Apache License 2.0
11 stars 9 forks source link

CMS Upgrade issue: unable to edit any content if an xsl custom control is present that does not parse or compile #566

Closed natechadwick closed 1 year ago

natechadwick commented 2 years ago

This will need at least a documentation note and affects both rhythmyx and percussion cms upgrade to version >= 8.0.3.

if a customer has created any custom xsl editor controls in rx_resources/stylesheets after upgrade all content editors will fail to load with the following error:

Could not compile stylesheet
 C:com.percussion.data.PSStyleSheetMerger:L:235.
The call-stack was:
An exception occurred while processing the ContentEditor XML document through the file:sys_resources/stylesheets/contentEdit.xsl style sheet: javax.xml.transform.TransformerConfigurationException: Could not compile stylesheetThe entity "nbsp" was referenced, but not declared.
Could not compile stylesheet
 C:com.percussion.data.PSStyleSheetMerger:L:235

This error is caused because all custom controls in rx_resources/stylesheets/controls are imported via xsl so that the controls are available to all content editors (legacy and non-legacy).

As part of the upgrade any user provided custom controls need to be updated to include the following doctype and stylesheet directive:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE xsl:stylesheet [
        <!ENTITY % HTMLlat1 PUBLIC "-//W3C//ENTITIES_Latin_1_for_XHTML//EN" "https://www.percussion.com/DTD/HTMLlat1x.ent">
        %HTMLlat1;
        <!ENTITY % HTMLsymbol PUBLIC "-//W3C//ENTITIES_Symbols_for_XHTML//EN" "https://www.percussion.com/DTD/HTMLsymbolx.ent">
        %HTMLsymbol;
        <!ENTITY % HTMLspecial PUBLIC "-//W3C//ENTITIES_Special_for_XHTML//EN" "https://www.percussion.com/DTD/HTMLspecialx.ent">
        %HTMLspecial;
        <!ENTITY % w3centities-f PUBLIC
                "-//W3C//ENTITIES Combined Set//EN//XML"
                "http://www.w3.org/2003/entities/2007/w3centities-f.ent"
                >
        %w3centities-f;
        ]>
<xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:psxctl="urn:percussion.com/control"
                xmlns="http://www.w3.org/1999/xhtml" xmlns:psxi18n="com.percussion.i18n"
                extension-element-prefixes="psxi18n" exclude-result-prefixes="psxi18n">

This is needed so that the doctypes / namespaces resolve against the /PercussionXMLCatalog.xml file as loading external entities from anywhere but that catalog or /var/config/CustomXMLCatalog.xml is blocked for security.

natechadwick commented 1 year ago

Updated help content here: