Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-14661

ODF Import is broken

    XMLWordPrintable

Details

    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.

      Attachments

        1. bug14661.diff
          1 kB
        2. Sega.odt
          105 kB

        Activity

          People

            andre1 andre1
            bf bf
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: