Affects Version/s: 7.0.X, 7.1.X, 7.2.X, Master
- Login as Admin
- Go to Content→Documents and Media→+symbol in the bottom right corner→Basic Document
- Upload the attached file (test.jpg)
- Change the title from test.jpg to test
- Click on Publish
- Go to Content→Web Content→kebab menu in the top right corner→Structures
- Click the + symbol in the bottom right corner
- Title: Test Structure
- Copy the content from the attached file testStructure.json into the Source tab→Save
- Go to Content→Web Content→+ symbol→Test Structure
- Click into the Content field→+ sign→leftmost button [Insert Image]→click on Test
- In the Item selector view, choose the Tab Documents and Media
- Click on Test.jpg
- Find the pencil button in the bottom right corner and click on it
- Edit the image (e.g. crop it) and click Apply when finished→Save
- Expected Behavior*
The image will be saved as a copy and added to the Web Content.
- Actual Behavior*
After clicking Save the loading image appears but the image window stays open. The image is not saved as a copy and added to the Web Content.
When we upload the file and remove the extension from the tile it is displayed correctly in documents and media. I can even edit the given image from here with the image-editor.(click kebab menu, click "edit with ImagEditor")
When we access the documents from the item-selector(through our web-content), the title of the image will contain the extension. This is what causes the issue, as we will create a copy from the image and use the given title for saving the file later, and it will throw an exception when we validate the file in DLFileEntryLocalServiceImpl.java:
We will fail the second if check, as our original image "fileName"(not the title) was indeed "test.jpg".
Very similar to
LPS-65890, the extension is the key to reproduce the issue and it was missing from the description.