Affects Version/s: 7.0.2 CE GA3, 7.0.0 DXP FP13, 7.0.X EE
Component/s: ~[Archived] WCM > Publication
Steps to reproduce it:
- Startup a Liferay 6.1 (you can use other version like 6.2 or 6.0)
- Create a WCM Structure with an image field.
- Create a template for that structure
- Create an article for that structure and fill the image field
- Upgrade to DXP
- Open WCM editor for previous article and realize that you see the image preview
- Publish the article and check the editor again.
You can't see the image preview
You can see the image preview.
The issue is caused by the fact that we don't add languageId value for JournalArticleImage in previous Liferay versions when we add a new image if the field isn't localized. Now, in com.liferay.journal.service.impl.JournalArticleLocalServiceImpl#formatImage we call journalArticleImageLocalService.getArticleImageId to get the previous image using the language and it will never find the old image. That method getArticleImageId also generates a new record if there is no image! For those reasons previous image is not found and, if you don't add a new image, the new article version loses the image.