2626 */
2727namespace OCA \WorkflowEngine \Check ;
2828
29+ use OC \Files \Storage \Wrapper \Jail ;
2930use OCA \Files_Sharing \SharedStorage ;
3031use OCA \WorkflowEngine \Entity \File ;
3132use OCP \Files \Cache \ICache ;
3940use OCP \SystemTag \TagNotFoundException ;
4041use OCP \WorkflowEngine \ICheck ;
4142use OCP \WorkflowEngine \IFileCheck ;
42- use OC \Files \Storage \Wrapper \Wrapper ;
4343
4444class FileSystemTags implements ICheck, IFileCheck {
4545 use TFileCheck;
@@ -154,27 +154,15 @@ protected function getSystemTags() {
154154 * @return int[]
155155 */
156156 protected function getFileIds (ICache $ cache , $ path , $ isExternalStorage ) {
157- /** @psalm-suppress InvalidArgument */
158- if ($ this ->storage ->instanceOfStorage (\OCA \GroupFolders \Mount \GroupFolderStorage::class)) {
159- // Special implementation for groupfolder since all groupfolders share the same storage
160- // id so add the group folder id in the cache key too.
161- $ groupFolderStorage = $ this ->storage ;
162- if ($ this ->storage instanceof Wrapper) {
163- $ groupFolderStorage = $ this ->storage ->getInstanceOfStorage (\OCA \GroupFolders \Mount \GroupFolderStorage::class);
164- }
165- if ($ groupFolderStorage === null ) {
166- throw new \LogicException ('Should not happen: Storage is instance of GroupFolderStorage but no group folder storage found while unwrapping. ' );
167- }
168- /**
169- * @psalm-suppress UndefinedDocblockClass
170- * @psalm-suppress UndefinedInterfaceMethod
171- */
172- $ cacheId = $ cache ->getNumericStorageId () . '/ ' . $ groupFolderStorage ->getFolderId ();
157+ $ cacheId = $ cache ->getNumericStorageId ();
158+ if ($ this ->storage ->instanceOfStorage (Jail::class)) {
159+ $ absolutePath = $ this ->storage ->getUnjailedPath ($ path );
173160 } else {
174- $ cacheId = $ cache -> getNumericStorageId () ;
161+ $ absolutePath = $ path ;
175162 }
176- if (isset ($ this ->fileIds [$ cacheId ][$ path ])) {
177- return $ this ->fileIds [$ cacheId ][$ path ];
163+
164+ if (isset ($ this ->fileIds [$ cacheId ][$ absolutePath ])) {
165+ return $ this ->fileIds [$ cacheId ][$ absolutePath ];
178166 }
179167
180168 $ parentIds = [];
@@ -189,7 +177,7 @@ protected function getFileIds(ICache $cache, $path, $isExternalStorage) {
189177 $ parentIds [] = $ fileId ;
190178 }
191179
192- $ this ->fileIds [$ cacheId ][$ path ] = $ parentIds ;
180+ $ this ->fileIds [$ cacheId ][$ absolutePath ] = $ parentIds ;
193181
194182 return $ parentIds ;
195183 }
0 commit comments