Localized titleMap for Attachment - defaultLocale title on a Map UnmodifiableMap Problem

Description

Error reported in the last step of this blog: https://liferay.dev/blogs/-/blogs/integracion-liferay-commerce-con-etl-tratamiento-de-datos-y-carga-de-productos-parte-4

It is possible to reproduce the error if:

"send a product through the API "/o/headless-commerce-admin-catalog/v1.0/products/" with different language from the default site and within the attachment "titleMap" array, and the default language does not exist from the website."

The error occurs when trying to add the translation into the list by defeault the portal instance for the image title (CPAttachmentFileEntryLocalServiceImpl.java:136). The reason is because it tries to add the default language to an object that was used "LanguageUtils.getLocalizedMap" that returns a "Collections.unmodifiableMap".

 

Log Error: 

java.lang.UnsupportedOperationException     at java.util.Collections$UnmodifiableMap.put(Collections.java:1457)     at com.liferay.commerce.product.service.impl.CPAttachmentFileEntryLocalServiceImpl.addCPAttachmentFileEntry(CPAttachmentFileEntryLocalServiceImpl.java:136)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  

Attachments

1
  • 29 Jun 2020, 07:30 AM

Activity

Show:

Lorenzo La PescaraJuly 3, 2020 at 4:15 AM

Check MarkQA PASSED.
Info ENV:
Portal: brianchandotcom/liferay-portal-ee:7.1.x
Git ID: 29d07ba65e61cbb724f3e45250af95da8d642c1f
OS: Ubuntu 18.04
Browser: Google Chrome - Version 83.0.4103.61 (Official Build) (64-bit)
DB: MySQL - Ver 14.14 Distrib 5.7.29, for Linux (x86_64)

Igor BeslicJune 29, 2020 at 7:32 AM

Dear QA:
I attached talend job that can test issue. Just set context variable productID to an existing product. Job will attempt to replicate product.
If job fails it means issue is still present.

Good luck with Talend, if any help needed with it please contact me.

Igor BeslicJune 29, 2020 at 6:39 AM

Reproduced... Bravo ! thumbs up

Fixed
Pinned fields
Click on the next to a field label to start pinning.
Created June 10, 2020 at 11:56 PM
Updated July 30, 2020 at 8:54 AM
Resolved July 1, 2020 at 6:11 AM

Flag notifications