Details
-
Bug
-
Resolution: Fixed
-
Medium
-
None
-
None
-
Operating System: OS X
PHP Version: 5.2
Database and version:
Browser (and version):
Description
Importing an ODF document does no longer work in 4.1 on OS X. The issue(s) is related to the conversion from eZXML to DOMXML in PHP. When importing a document the content is empty and image attributes are not stored.
The following patch fixes this issue:
--- ezpublish-4.1.0/extension/ezodf/modules/ezodf/ezooimport.php 2009-03-17 16:28:20.000000000 -0500 +++ ezooimport.php 2009-03-24 10:08:25.000000000 -0500 @@ -720,7 +726,9 @@ class eZOOImport $imageNode = $children->item( 0 ); if ( $imageNode && $imageNode->localName == "image" ) { - $fileName = $imageNode->getAttribute( "href" ); + //$fileName = $imageNode->getAttribute( "href" ); + $fileName = ltrim( $imageNode->getAttributeNS( self::NAMESPACE_XLINK, 'href' ), '#' ); + $filePath = $this->ImportDir . $fileName; if ( file_exists( $filePath ) ) @@ -1378,8 +1385,14 @@ class eZOOImport */ function handleInlineNode( $childNode, $nextLineBreak = false, $prevLineBreak = false ) { + if ( $childNode->localName == "" ) + $localName = $childNode->nodeName; + else + $localName = $childNode->localName; + + // Get the real name $paragraphContent = ""; - switch ( $childNode->localName ) + switch ( $localName ) { case "frame": {
Steps to reproduce
Log into eZ Publish and try to import the attached document. Make sure to have defined caption, publish_date and unpublish_date in the odf.ini for proper matching to the article class.