Closed petrenkonikita112263 closed 7 months ago
@petrenkonikita112263 you need to explain your use case. Why do you need to add an attachment to a File Manager page? What are you trying to achieve? Normally you shouldn't add attachments to the File Manager's pages. You should interact with the File Manager pages through the File Manager UI. I agree that the code could be bulletproofed to ignore the extra attachments, but that's a minor issue.
Normally you shouldn't add attachments to the File Manager's pages.
I agree with this. However, this type of action can be performed by simple users due to human factors. Admin of XWiki installed and configured File Manager (Pro), and all users should perform CRUD for any files via the pro app. Let's say some users will need to remember the home page of File Manager, but will remember their last event that there's a page with upload files and decide to add files as attachments. Due to this, the admin or other advanced users will see table replacements with duplications.
That's why I opened improvement as an alternative to this.
No longer needed after implementing https://github.com/xwikisas/application-filemanager/issues/92.
Note: firstly issue was reproduced on old version File Manager (Pro) 2.4 and XWiki platform 10.11.9
Prerequisites:
Step to reproduce:
Steps are shown in below GIF![firefox_t2w95eJdZl](https://github.com/xwikisas/application-filemanager/assets/56109799/67b7975c-9ca3-4f8e-841a-9543fa4411a5)
Actual result: Firstly, you'll not see your file from step 3, instead of it 2 duplications will be present - attachment from step 5, however both links will point to file from step 3 http://localhost:8080/xwiki/bin/view/FileManager/test.txt. Second if you click on this link you will not see content of file from step 3 - content of attachment from step 5
If you decide to select one of them, File Manager will automatically select a duplicate.![firefox_yPVcIlhpSQ](https://github.com/xwikisas/application-filemanager/assets/56109799/a684d579-9d51-46f4-a104-cbd92eb1d7f5)
In addition, if you open your folder in new tab - you will see only one attachment from step 5.![image](https://github.com/xwikisas/application-filemanager/assets/56109799/60a2cf44-0dae-4fef-961b-84632c8a1441)
Expected result: No duplication in FileManager.WebHome and uploaded attachment doesn't replace visually uploaded file.