Skip to content

Adding video gallery item through API does not set extension attributes #7153

Closed
@bartlubbersen

Description

@bartlubbersen

Preconditions

  1. Magento 2.1.2
  2. PHP7

Steps to reproduce

  1. Go to swagger or call rest API through script
  2. Try updating or creating a product with a video_url, video_title etc. with media type "external-video".
  3. I used the following JSON:
{
  "product": {
    "sku": "SKU",
    "media_gallery_entries": [
        {
            "media_type": "external-video",
            "disabled": false,
            "label": "",
            "types": [],
            "content": {
                "type": "image/jpeg",
                "name": "FyL6smNEMiU.jpg",
                "base64_encoded_data": "encoded_image"
            },
            "extension_attributes": {
                "video_content": {
                    "media_type": "external-video",
                    "video_url": "https://youtu.be/FyL6smNEMiU",
                    "video_title": "Video title",
                    "video_description": "Video description"
                }
            }
        }
    ]
  },
  "saveOptions": true
}

Ofcourse I used a valid base64 encoded image as thumbnail and used a correct SKU.

Expected result

Product should be created or updated with a valid video gallery item, which should have all necessary attributes filled like video_url and video_title.

Actual result

The product is updated, however there is only a thumbnail image and no video attributes. If you will load the product through API you will get the item back with the right media_type but without attributes.

Comment

I think it has something to do with the fact that the productRepository is handling the gallery entries by itself and is not yet processing any of the extension_attributes for gallery items.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: Framework/WebapiUSE ONLY for FRAMEWORK RELATED BUG! E.g If bug related to Catalog WEB API use just CatalogIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentbug report

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions