Bug #81836

deleting a file inside _recycler_ folder generates new file with preview_ prefix

Added by Alexander Grein over 2 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Recycler
Start date:
2017-07-11
Due date:
% Done:

100%

TYPO3 Version:
8
PHP Version:
7.0
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

To reproduce:
  1. Add a folder called recycler
  2. Delete any image file somewhere inside fileadmin
  3. Take a look inside recycler folder and see (first bug) an additional preview_-File
  4. Try to delete one of those files inside recycler folder and see the new generated files with preview_ prefix
  5. Same problem exists if you try to delete old files using scheduler task

Related issues

Related to TYPO3 Core - Bug #85019: Recycler folder detection loop does not end Closed 2018-05-16
Related to TYPO3 Core - Bug #85079: You are not allowed to access the given folder: "user_upload" Closed 2018-05-25
Related to TYPO3 Core - Bug #88632: File cannot be deleted from a storage that is not browsable Resolved 2019-06-26
Duplicates TYPO3 Core - Bug #79116: Delete-infinite-loop: fileadmin/_recycler_ preview images Closed 2016-12-30

Associated revisions

Revision 0d583b43 (diff)
Added by Guido S. over 1 year ago

[BUGFIX] Do not move processed files to recycler folder

When a file gets moved to the recycler folder on delete. The processed
files should not be moved to the recycler folder but directly deleted.

Resolves: #81836
Releases: master, 8.7
Change-Id: I7a53830ea5d96735243fd9ee89e8c5aa80d084c0
Reviewed-on: https://review.typo3.org/56503
Reviewed-by: Frank Naegler <>
Tested-by: TYPO3com <>
Reviewed-by: Frans Saris <>
Tested-by: Frans Saris <>
Reviewed-by: Guido Schmechel <>
Tested-by: Guido Schmechel <>
Reviewed-by: Mathias Schreiber <>
Tested-by: Mathias Schreiber <>
Reviewed-by: Nicole Cordes <>
Tested-by: Nicole Cordes <>

Revision 594059c6 (diff)
Added by Nicole Cordes over 1 year ago

[BUGFIX] Do not move processed files to recycler folder

When a file gets moved to the recycler folder on delete. The processed
files should not be moved to the recycler folder but directly deleted.

Resolves: #81836
Releases: master, 8.7
Change-Id: I7a53830ea5d96735243fd9ee89e8c5aa80d084c0
Reviewed-on: https://review.typo3.org/56917
Tested-by: TYPO3com <>
Reviewed-by: Guido Schmechel <>
Tested-by: Guido Schmechel <>
Reviewed-by: Alessandro Filira <>
Tested-by: Alessandro Filira <>
Reviewed-by: Nicole Cordes <>
Tested-by: Nicole Cordes <>

Revision a52ca0e9 (diff)
Added by Nicole Cordes over 1 year ago

[BUGFIX] Handle access restrictions on recycler search

Fetching a parent folder may throws an error if the user hasn't
access to the parent. This exception needs to be caught and the
search for an existing recycler folder needs to be stopped
immediately.

Furthermore the patch removes the comparison with the root level
folder but checks the parent folder doesn't equal the folder itself.

Another loop is fixed by calling moveFile on the correct
ResourceStorge and not the current one.

Resolves: #85079
Related: #81836
Releases: master, 8.7
Change-Id: I51f5e20d7fa7da9b350ac0ca60cab05866a4d337
Reviewed-on: https://review.typo3.org/57052
Tested-by: TYPO3com <>
Reviewed-by: Markus Klein <>
Tested-by: Markus Klein <>
Reviewed-by: Frans Saris <>
Tested-by: Frans Saris <>

Revision 68c78a75 (diff)
Added by Nicole Cordes over 1 year ago

[BUGFIX] Handle access restrictions on recycler search

Fetching a parent folder may throws an error if the user hasn't
access to the parent. This exception needs to be caught and the
search for an existing recycler folder needs to be stopped
immediately.

Furthermore the patch removes the comparison with the root level
folder but checks the parent folder doesn't equal the folder itself.

Another loop is fixed by calling moveFile on the correct
ResourceStorge and not the current one.

Resolves: #85079
Related: #81836
Releases: master, 8.7
Change-Id: I51f5e20d7fa7da9b350ac0ca60cab05866a4d337
Reviewed-on: https://review.typo3.org/57105
Reviewed-by: Frans Saris <>
Tested-by: Frans Saris <>

History

#1 Updated by Alexander Grein about 2 years ago

This problem also exists in TYPO3 7.6.20

#2 Updated by Riccardo De Contardi over 1 year ago

  • Status changed from New to Needs Feedback

Where should the "recycler" folder be added? Inside fileadmin? Could you add a step-by-step guide about how to reproduce this issue? Thank you!

#3 Updated by Alexander Grein over 1 year ago

Step-by-Step Guide for TYPO3 8.7.9
  1. Open Backend-Module Filelist
  2. Click on the root of "fileadmin/ (auto-created)" storage
  3. Click on the Plus-Sign to add a new folder named `_recycler_`
  4. Go to any other folder and upload a picture (e.g. a png image) to it
  5. Click on the same folder again, where you uploaded the picture and press the delete icon (bucket), available in the extended view
  6. Change to the former created `_recycler_` folder and realize two new files: the deleted one and a file named 'preview_' + filename_of_the_deleted_file_without_extension + '_' + hash + fileextension_of_the_deleted_file
  7. Deleting the deleted file inside this recycler folder again, by pressing the delete icon works perfect
  8. Try to delete the 'preview_'-file ends with a new generated preview-file with this schema: + 'preview_preview_' + filename_of_the_deleted_file_without_extension + '_' + hash + '_' + hash + fileextension_of_the_deleted_file
  9. If you try to delete this again you will get a new file 'preview_preview_preview_' + filename_of_the_deleted_file_without_extension + '_' + hash + '_' + hash + '_' + hash + fileextension_of_the_deleted_file
  10. And so on

#4 Updated by Riccardo De Contardi over 1 year ago

  • Status changed from Needs Feedback to New

I am able to reproduce it on 8.7.10, even deleting the "normal" <filename> I get a new file preview_<filename>_<hash>

It seems solved on version 9.2.0 can you confirm?

#5 Updated by Guido S. over 1 year ago

Can confirm it with latest master (9.2.-dev)

CASE A: "normal" <filename> I get a new file preview_<filename>_<hash>
If you upload a file TYPO3 generates a preview image in typo3\sysext\core\Classes\Resource\Processing\LocalPreviewHelper.php::process() So if you delete the parent, you should delete the child. That's fine. I think we can delete this image file directly. If you recover the original file, it generates a new preview image.

CASE B: Recursive preview files is reproducable with option "Display thumbnails"
If you have delete the preview image and activate "display thumbnails" the processTask generate a new preview image. If we handle Case A correctly (delete preview image), we haven't got this problem.

#6 Updated by Gerrit Code Review over 1 year ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56503

#7 Updated by Guido S. over 1 year ago

  • Duplicates Bug #79116: Delete-infinite-loop: fileadmin/_recycler_ preview images added

#8 Updated by Riccardo De Contardi over 1 year ago

  • Status changed from Under Review to Closed

#9 Updated by Riccardo De Contardi over 1 year ago

  • Status changed from Closed to Under Review

sorry, wrong closing

#10 Updated by Gerrit Code Review over 1 year ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56503

#11 Updated by Gerrit Code Review over 1 year ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56503

#12 Updated by Gerrit Code Review over 1 year ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56503

#13 Updated by Gerrit Code Review over 1 year ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56503

#14 Updated by Gerrit Code Review over 1 year ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56503

#15 Updated by Gerrit Code Review over 1 year ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56503

#16 Updated by Gerrit Code Review over 1 year ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56503

#17 Updated by Gerrit Code Review over 1 year ago

Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56503

#18 Updated by Gerrit Code Review over 1 year ago

Patch set 10 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56503

#19 Updated by Gerrit Code Review over 1 year ago

Patch set 11 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56503

#20 Updated by Gerrit Code Review over 1 year ago

Patch set 12 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56503

#21 Updated by Gerrit Code Review over 1 year ago

Patch set 13 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56503

#22 Updated by Gerrit Code Review over 1 year ago

Patch set 14 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56503

#23 Updated by Gerrit Code Review over 1 year ago

Patch set 15 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56503

#24 Updated by Gerrit Code Review over 1 year ago

Patch set 16 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56503

#25 Updated by Gerrit Code Review over 1 year ago

Patch set 17 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56503

#26 Updated by Gerrit Code Review over 1 year ago

Patch set 18 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56503

#27 Updated by Gerrit Code Review over 1 year ago

Patch set 19 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56503

#28 Updated by Guido S. over 1 year ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#29 Updated by Gerrit Code Review over 1 year ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56917

#30 Updated by Nicole Cordes over 1 year ago

  • Status changed from Under Review to Resolved

#31 Updated by Alexander Stehlik over 1 year ago

  • Related to Bug #85019: Recycler folder detection loop does not end added

#32 Updated by Nicole Cordes over 1 year ago

  • Related to Bug #85079: You are not allowed to access the given folder: "user_upload" added

#33 Updated by Benni Mack about 1 year ago

  • Status changed from Resolved to Closed

#34 Updated by Markus Klein 4 months ago

  • Related to Bug #88632: File cannot be deleted from a storage that is not browsable added

Also available in: Atom PDF