Forums / Extensions / Website Interface / Visual editor - error while save document

Visual editor - error while save document

Author Message

Aleksey Tik

Saturday 12 April 2008 4:11:44 am

When i try save Fronpage obget with table created in visual editor i get exeption

Fatal error: Uncaught exception 'DOMException' with message 'Not Found Error' in /var/www/ez/kernel/classes/datatypes/ezxmltext/ezxmlinputparser.php:1019 Stack trace: #0 /var/www/ez/kernel/classes/datatypes/ezxmltext/ezxmlinputparser.php(1019): DOMNode->removeChild(Object(DOMElement)) #1 /var/www/ez/kernel/classes/datatypes/ezxmltext/ezxmlinputparser.php(1025): eZXMLInputParser->fixSubtree(Object(DOMElement), Object(DOMElement)) #2 /var/www/ez/kernel/classes/datatypes/ezxmltext/ezxmlinputparser.php(997): eZXMLInputParser->fixSubtree(Object(DOMElement), Object(DOMElement)) #3 /var/www/ez/kernel/classes/datatypes/ezxmltext/ezxmlinputparser.php(888): eZXMLInputParser->processBySchemaTree(Object(DOMElement)) #4 /var/www/ez/kernel/classes/datatypes/ezxmltext/ezxmlinputparser.php(846): eZXMLInputParser->processSubtree(Object(DOMElement), NULL) #5 /var/www/ez/kernel/classes/datatypes/ezxmltext/ezxmlinputparser.php(846): eZXMLInputParser->processSubtree(Object(DOMElement), Object(DOMElement)) #6 /var/www/ez/kernel/classes/datatyp in /var/www/ez/kernel/classes/datatypes/ezxmltext/ezxmlinputparser.php on line 1019
Fatal error: eZ Publish did not finish its request

The execution of eZ Publish was abruptly ended, the debug output is present below.

as I understand this occur becouse table structure was damaged (table looks like one <td></td> tag pair was losted. I can't say more becouse i can't disable visual editor). Only way to resolve it i found is to delete table.

Bastian Fenske

Tuesday 15 April 2008 2:13:13 am

This works for me:


    // Remove only nodes that don't match schema (recursively)
    function fixSubtree( $element, &$mainChild )
    {
        $parent = $element->parentNode;
        $mainParent = $mainChild->parentNode;
        if ( $element->hasChildNodes() )
        {
            // http://php.net/manual/en/domnode.removechild.php#56556
            $childNodes = array();
            foreach($element->childNodes as $childNode) {
           	    $childNodes[] = $childNode;
            }
   
            foreach ($childNodes as $childNode) {
            	
                $childNode = $childNode->parentNode->removeChild($childNode);
                $childNode = $mainParent->insertBefore( $childNode, $mainChild );

                if ( !$this->XMLSchema->check( $mainParent, $childNode ) )
                {
                    $this->fixSubtree( $childNode, $mainChild );
                }
            }
        }
        $element = $parent->removeChild( $element );
    }

Basti

Carsten Koehler

Monday 07 July 2008 2:30:56 am

I had the same error message. After the change, I was able to save again.

But now I have a new problem. Newly created articles are completely saved as a link to itself. Modify I then a second time, the text layout is saved as I wish. How can I eliminate this problem?