Bug #88895
closedAuto-creates wrong folders if groupHomePath is used.
100%
Description
I have this configuration, which is dynamically set from a hook:
module.tx_form.settings.yamlSettingsOverrides.persistenceManager.allowedFileMounts.1 = 1:groups/<uid>/forms/
We are using the groupHomePath core feature. Here you can define a path - for example 1:groups/. Then if you are member of backendgroup with uid 200, you will automatically get a mount to 1:groups/200/ if that folders exists.
I have a problem when ext:form tries to create the folder. Instead of 1:groups/200/forms it created this path instead: 1:groups/200/groups/200/forms
The reason seems to be when \TYPO3\CMS\Core\Resource\ResourceStorage::createFolder()
tries to get the parentFolder - instead of getting just 1:
- it gets 1:/groups/200
- probably as the user does not have access to parent folders (because of the way userGroupHome works).
That way it creates 1:/groups/200/groups/200/forms/
instead.
Updated by Stig Nørgaard Færch over 5 years ago
I have made this fix.
I'm not in the loop on how this is done the right way, as we seldom contribute this way...
Hope someone can help me getting this fixed...
/Stig
Index: public/typo3/sysext/form/Classes/Mvc/Persistence/FormPersistenceManager.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- public/typo3/sysext/form/Classes/Mvc/Persistence/FormPersistenceManager.php (date 1564755837000)
+++ public/typo3/sysext/form/Classes/Mvc/Persistence/FormPersistenceManager.php (date 1564755837000)
@@ -459,7 +459,14 @@
try {
$folder = $storage->getFolder($fileMountIdentifier);
} catch (FolderDoesNotExistException $e) {
- $storage->createFolder($fileMountIdentifier);
+ //Fix to make sure that the folder is create correctly when using groupHomePath https://forge.typo3.org/issues/88895
+ if(strpos(str_replace(':/',':', $storage->getRootLevelFolder()->getCombinedIdentifier()), $GLOBALS['TYPO3_CONF_VARS']['BE']['groupHomePath']) === 0) {
+ $groupHomeFolder = $storage->getRootLevelFolder();
+ $groupHomeFolder->createFolder(str_replace($storage->getRootLevelFolder()->getIdentifier(),'', '/'. $fileMountIdentifier));
+ } else {
+ if(strpos($allowedFileMount, $GLOBALS['TYPO3_CONF_VARS']['BE']['groupHomePath']) === 0) continue;
+ $storage->createFolder($fileMountIdentifier);
+ }
continue;
} catch (InsufficientFolderAccessPermissionsException $e) {
continue;
Updated by Stig Nørgaard Færch over 5 years ago
@susanne.moog
When does this Coding Night take place?
Updated by Susanne Moog about 5 years ago
- Complexity deleted (
easy) - Sprint Focus set to Remote Sprint
Updated by Ralf Zimmermann almost 5 years ago
- Status changed from New to In Progress
Updated by Gerrit Code Review almost 5 years ago
- Status changed from In Progress 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/c/Packages/TYPO3.CMS/+/62415
Updated by Gerrit Code Review almost 5 years 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/c/Packages/TYPO3.CMS/+/62415
Updated by Gerrit Code Review almost 5 years 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/c/Packages/TYPO3.CMS/+/62415
Updated by Gerrit Code Review almost 5 years 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/c/Packages/TYPO3.CMS/+/62415
Updated by Gerrit Code Review almost 5 years 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/c/Packages/TYPO3.CMS/+/62415
Updated by Gerrit Code Review almost 5 years ago
Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62400
Updated by Ralf Zimmermann almost 5 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset e185f39d9854bdc266926e5ec925418701f1bb1c.
Updated by Benni Mack almost 5 years ago
- Status changed from Resolved to Closed