Details
-
Bug
-
Resolution: Fixed
-
High
-
4.7.0, 5.0, 5.1, 5.2, 2015.01, 5.3.4, 5.4.1
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
- Edit ezpublish_legacy/settings/override/site.ini.append.php and add the following lines
[ContentSettings] ContentObjectNameLimit=255 [URLTranslator] TransformationGroup=urlalias_iri
- Create a new image content object, name it "Θα λειτουργήσει θα λειτουργήσει θα λειτουργήσει θα λειτουργήσει θα λειτουργήσει θα λειτουργήσει θα λειτουργήσει θα λειτουργήσει θα λειτουργήσει" and upload a dummy image file.
- Publish it