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

Error when translate a content with no image

    XMLWordPrintable

Details

    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']))

      {return false;}

      Best Regards,
      Alexandre

      Attachments

        Activity

          People

            Unassigned Unassigned
            alex57 alex57
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day
                1d