Details
-
Bug
-
Resolution: Fixed
-
High
-
1.7.3, 1.9.1
-
None
-
LAMP
Description
Hello,
There are an error when we translate a content with a field "image" "not required" and "not translatable"
Step for reproduce :
1. Create a content type with field "image" not required and not translatable
2. Create the content in french language and don't set an image
3. Translate the content in english from the french
4. Publish
There are this error :
"ErrorMessage": {
"_media-type": "application\/vnd.ez.api.ErrorMessage+json",
"errorCode": 500,
"errorMessage": "Internal Server Error",
"errorDescription": "Notice: Undefined index: uri",
"trace": "#0 \/var\/www\/ezpublish\/vendor\/ezsystems\/ezpublish-kernel\/eZ\/Publish\/Core\/Persistence\/Legacy\/Content\/FieldValue\/Converter\/ImageConverter.php(137)
This quick patch seem to correct the first error (add line 128) :
if (!isset($imageData['uri'])) return null;
There a 2nd error :
"errorMessage": "Internal Server Error",
"errorDescription": "Notice: Undefined index: id",
"trace": "#0 \/var\/www\/ezpublish\/vendor\/ezsystems\/ezpublish-kernel\/eZ\/Publish\/Core\/FieldType\/Image\/ImageStorage.php(116):
This 2nd quick patch seem to correct the 2nd error (add line 115) :
if(!isset($field->value->data['id']))
Best Regards,
Alexandre