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

Image content with big multibyte charset names won't be correctly created

    XMLWordPrintable

Details

    Description

      The fix from EZP-21410 will allow you to create objects with multibyte names as big as object name limit setting. The problem is Operating System won't allow you to create a name with more than 255 bytes, and will count the multibyte as characters as more than one byte.

      An easy way to see this is to execute the following command in you shell

      touch Θα-λειτουργήσει-θα-λειτουργήσει-θα-λειτουργήσει-θα-λειτουργήσει-θα-λειτουργήσει-θα-λειτουργήσει-θα-λειτουργήσει-θα-λειτουργήσει-θα-λειτουργήσει.diff
      

      And see the result

      touch: cannot touch `Θα-λειτουργήσει-θα-λειτουργήσει-θα-λειτουργήσει-θα-λειτουργήσει-θα-λειτουργήσει-θα-λειτουργήσει-θα-λειτουργήσει-θα-λειτουργήσει-θα-λειτουργήσει.diff': File name too long

      Because of this, the creation of Image and File Objets will fail in eZ Publish when it tries to use move_uploaded_file

      if ( !move_uploaded_file( $this->Filename, $dest_name ) )
      {
      	eZDebug::writeError( "Failed moving uploaded file " . $this->Filename . " to destination $dest_name" );
      	unlink( $dest_name );
      	$ret = false;
      }
      

      In the legacy log file, you will see

      [ Mar 04 2015 12:00:48 ] [192.168.2.70]:
      Failed moving uploaded file /tmp/phpxebt4i to destination var/ezdemo_site/storage/images-versioned/764/1-eng-GB/Θα-λειτουργήσει-θα-λειτουργήσει-θα-λειτουργήσει-θα-λειτουργήσει-θα-λειτουργήσει-θα-λειτουργήσει-θα-λειτουργήσει-θα-λειτουργήσει-θα-λειτουργήσει2.jpg

      [ Mar 04 2015 12:00:48 ] [192.168.2.70] eZImageManager::createImageAlias:
      The reference alias original file var/ezdemo_site/storage/images-versioned/764/1-eng-GB/Θα-λειτουργήσει-θα-λειτουργήσει-θα-λειτουργήσει-θα-λειτουργήσει-θα-λειτουργήσει-θα-λειτουργήσει-θα-λειτουργήσει-θα-λειτουργήσει-θα-λειτουργήσει2.jpg does not exist

      [ Mar 04 2015 12:00:48 ] [192.168.2.70]:
      Original alias does not exist, cannot create other aliases without it

      Steps to reproduce

      1. Edit ezpublish_legacy/settings/override/site.ini.append.php and add the following lines
        [ContentSettings]
        ContentObjectNameLimit=255
        
        [URLTranslator]
        TransformationGroup=urlalias_iri
        
      2. Create a new image content object, name it "Θα λειτουργήσει θα λειτουργήσει θα λειτουργήσει θα λειτουργήσει θα λειτουργήσει θα λειτουργήσει θα λειτουργήσει θα λειτουργήσει θα λειτουργήσει" and upload a dummy image file.
      3. Publish it

      Attachments

        Activity

          People

            Unassigned Unassigned
            eduardo.fernandes-obsolete@ez.no Eduardo Fernandes (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: