Details
-
Bug
-
Resolution: Duplicate
-
Medium
-
extension/ezodf 2.3.0
-
None
-
Operating System: OS X
PHP Version: 5.2.5
Database and version:
Browser (and version):
Description
The ODF import is missing some namespace definitions to work with sections defined using styled headers (which is the default in the 4.1 ODF export).
Try import with the attached document and notice that the matching based on section definitions does not work.
Remember to make sure that the caption, publishing and unpublishing attributes are defined correctly in the ODF settings to match the article class.
The patch below fixes the issue.
--- /www/ezpublish-4.1.0/extension/ezodf/modules/ezodf/ezooimport.php 2009-03-24 10:08:25.000000000 -0500 +++ ezooimport.php 2009-03-27 15:08:51.000000000 -0500 @@ -439,7 +439,7 @@ class eZOOImport $eZSectionDefinitionStyleName = array(); foreach( $automaticStyleArray->item( 0 )->childNodes as $child ) { - if( $child->nodeType === XML_ELEMENT_NODE && $child->getAttribute( 'parent-style-name' ) == 'eZSectionDefinition' ) + if ( $child->nodeType === XML_ELEMENT_NODE && $child->getAttributeNS( self::NAMESPACE_TEXT, 'parent-style-name' ) == 'eZSectionDefinition' ) { $eZSectionDefinitionStyleName[] = $child->getAttribute('name'); } @@ -455,7 +455,7 @@ class eZOOImport $firstChildFlag = true; if ( $childNode->nodeType == XML_ELEMENT_NODE && ( in_array( $childNode->getAttribute( 'style-name' ), $eZSectionDefinitionStyleName ) || - $childNode->getAttribute( 'style-name' ) == 'eZSectionDefinition' ) + $childNode->getAttributeNS( self::NAMESPACE_TEXT, 'style-name' ) == 'eZSectionDefinition' ) ) { $firstChildFlag = false; @@ -468,12 +468,13 @@ class eZOOImport { $paragraphSectionNodeArray[ $paragraphSectionName ][] = $childNode; } + } $sectionNodeArray = array(); foreach ( $paragraphSectionNodeArray as $key => $childNodes ) { - $sectionNode = $dom->createElementNode( 'section' ); + $sectionNode = $dom->createElement( 'section' ); foreach ( $childNodes as $childNode ) {
Steps to reproduce
Import the attached document.
Look at the imported article, all content is placed in the body.
Attachments
Issue Links
- is duplicated by
-
EZP-14770 eZODF: exported document can not be imported due to fatal errors related to DOM port
- Closed