Bug #88895
closed
Auto-creates wrong folders if groupHomePath is used.
Added by Stig Nørgaard Færch over 5 years ago.
Updated almost 5 years ago.
Sprint Focus:
Remote Sprint
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.
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;
@susanne.moog
When does this Coding Night take place?
- Complexity deleted (
easy)
- Sprint Focus set to Remote Sprint
- Status changed from New to In Progress
- Status changed from In Progress to Under Review
- Description updated (diff)
- Description updated (diff)
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
- Status changed from Resolved to Closed
Also available in: Atom
PDF