#96376Link Browser (RTE and inputLink) and DefaultFactory creates user_upload folder even if uploads are diabled (and it creates it in a random storage)
Description
setup.default.edit_docModuleUpload = 0setup.override.edit_docModuleUpload = 0- clear cache
- clear UC cache
Expected: Link panel of an RTE does not show upload fields, only the file tree.
Actually happens: Link panel of an RTE does show upload fields, alongside the file tree.
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
History 10
-
S P commented and changed subject
userTSconfig edit_docModuleUpload = 0 is not respected in RTE link panelRTE link to file wizard creates user_upload folder even if uploads are diabled (and it creates it in a random storage) <span data-processor="relativetime" data-value="2021-12-17T10:32:20+00:00" > 12/17/21, 10:32 </span> -
S P changed subject
RTE link to file wizard creates user_upload folder even if uploads are diabled (and it creates it in a random storage)Link Browser (RTE and inputLink) creates user_upload folder even if uploads are diabled (and it creates it in a random storage) <span data-processor="relativetime" data-value="2021-12-20T06:27:29+00:00" > 12/20/21, 06:27 </span> -
S P commented <span data-processor="relativetime" data-value="2021-12-20T06:27:59+00:00" > 12/20/21, 06:27 </span>
Also true for
inputLinkTCA fields, this is a common LinkBrowser problem. -
S P commented <span data-processor="relativetime" data-value="2021-12-20T07:24:04+00:00" > 12/20/21, 07:24 </span>
The Link Browser controller and Fluid Templates are totally fine without receiving a pre-selected folder.
But the BackendUserAuthentication accesses the FAL API (LocalDriver in the end), which has the creation of the user_upload folder hardcoded.
The only way to currently circumvent this would be to set
I see four approaches here:options.defaultUploadFolder = x:/– howeverxmust be a uid of a storage. This is not possible if you have hundreds of BE users each having access to different sets of storage uids.- Either make it valid to have no upload directory in the FAL API / LocalDriver (as said: for Link Browser this is already valid).
- Provide a special key for the combined identifier to always pick the first storage of the current user, like
options.defaultUploadFolder = first:/which would select the root of first storage that the user has access to. - provide an Event before any calls to LocalDriver are done to be able to shortcut the creation of the user_upload folder
- Make it possible to define a custom default upload fodler for the LocalDriver instead of teh hardcoded
/user_upload/. For me it would be enough to set it to/(of the current storage).
-
S P commented <span data-processor="relativetime" data-value="2021-12-20T08:00:32+00:00" > 12/20/21, 08:00 </span>
For the reference, I now workaround it like this:
<?php declare(strict_types=1); namespace MyVendor\MyProject\Patches\FalApi; class LocalDriver extends \TYPO3\CMS\Core\Resource\Driver\LocalDriver { public function getDefaultFolder(): string { return '/'; } }And in
LocalConfiguration.php:'SYS' => [ 'fal' => [ 'registeredDrivers' => [ 'Local' => [ 'class' => \MyVendor\MyProject\Patches\FalApi\LocalDriver::class ] ] ] ] -
S P commented and changed subject
Link Browser (RTE and inputLink) creates user_upload folder even if uploads are diabled (and it creates it in a random storage)Link Browser (RTE and inputLink) and DefaultFactory creates user_upload folder even if uploads are diabled (and it creates it in a random storage) <span data-processor="relativetime" data-value="2021-12-21T09:28:30+00:00" > 12/21/21, 09:28 </span>We just noticed that the
DefaultFactoryof the CoreFolderStructurealso has user_upload as a default node. Why is this?It also has
All these directories are no “default” directories, they are only needed in very special scenarios:importexportas a default node, even whenext:impexpis not even installed…- Upload enabled for BE users at all with no other special folder configured (and then the FAL API creates the directory on-the-fly anyways)
ext:impexpinstalled (and I bet thsi extension creates it also on-the-fly, did not verify it because we don’t use it)
Why are these folders marked as “default”?
-
Benni Mack changed Sprint Focus Stabilization Sprint <span data-processor="relativetime" data-value="2023-06-06T13:01:03+00:00" > 06/06/23, 13:01 </span>
-
S P commented <span data-processor="relativetime" data-value="2025-01-09T08:33:14+00:00" > 01/09/25, 08:33 </span>
This seems to work on v13. I could not reproduce getting the
user_uploadfolder being generated if upload buttons are disabled via user TSconfig globally.It is still a “default factory folder”, however, which seems wrong to me. But as long as it does not get randomly recreated anymore while clicking in the BE GUI, after the initial setup was done once and the folder deleted, I consider this behaviour fixed.
-
Oliver Bartsch commented and changed status
NewClosed <span data-processor="relativetime" data-value="2025-01-09T10:03:59+00:00" > 01/09/25, 10:03 </span>Closed as requested by the author. In case you encounter this again, please feel free to contact me or create a new issue with reference to this one.
Additonal information:
options.folderTree.uploadFieldsInLinkBrowser = 0RTE link wizard does not allow uploads then – fine. But it still creates the
user_uploadfolder! This seems to be caused by the fact that the upload renderer that renders this file selector already gets a FolderObject passed:https://github.com/TYPO3/typo3/blob/f43979e74409500b731a98b39f978379669ed2e9/typo3/sysext/recordlist/Classes/View/FolderUtilityRenderer.php#L109
(which in turn invokes
LocalDriver->getDefaultFolder()whereuser_uploadis hardcoded)What we try to achieve in the very end is to prevent the
user_uploadfolder everyhwere. Because in our workflow the editors are forced to upload via file list module into normal folders and just reference files from there. Direct file uploads fromsys_file_referencefields or RTE are disallowed everyhwere.The next problem here is that the
user_uploadfolder is created in the first Storage that the user has in his file list. Which does not make any sense at all. We have users with multiple storages with uid > 1 (so even none of them is “fileadmin”! These user don’t see storage.uid=1 “fileadmin”). And just by opening the link wizard in an RTE creates theuser_uploadfolder in the first displayed file storage! This does not make sense at all (even if uploads would be enabled -> maybe the user wants to upload to a different storage).The
user_uploadfolder should only ever be created if an actual upload happens!