-
Type:
Bug
-
Status: Closed
-
Resolution: Fixed
-
Affects Version/s: 7.0.X, 7.1.X, 7.2.X, Master
-
Fix Version/s: 7.0.0 DXP FP93, 7.0.10.14 DXP SP14, 7.0.X, 7.1.10 DXP FP18, 7.1.10.5 SP5, 7.1.X, 7.2.10 DXP FP6, 7.2.X, 7.3.3 CE GA4, 7.3.10 DXP GA1, Master
-
Component/s: Image Editor, Item Selector
-
Branch Version/s:7.2.x, 7.1.x, 7.0.x
-
Backported to Branch:Committed
-
Story Points:1
-
Fix Priority:4
-
Git Pull Request:
Reproduction:
- 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.
Root cause:
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:
public void validateFile( long groupId, long folderId, long fileEntryId, String fileName, String title) throws PortalException { _validateFolder(groupId, folderId, title); DLFileEntry dlFileEntry = dlFileEntryPersistence.fetchByG_F_T( groupId, folderId, title); if ((dlFileEntry != null) && (dlFileEntry.getFileEntryId() != fileEntryId)) { throw new DuplicateFileEntryException( "A file entry already exists with title " + title); } dlFileEntry = dlFileEntryPersistence.fetchByG_F_FN( groupId, folderId, fileName); if ((dlFileEntry != null) && (dlFileEntry.getFileEntryId() != fileEntryId)) { throw new DuplicateFileEntryException( "A file entry already exists with file name " + title); } }
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.
- Testing discovered
-
LPS-114258 Image Editor toolbar is not visible
- Closed