@@ -95,32 +95,36 @@ public function installTranslations(string $appId, string $dirTranslations): str
9595	}
9696
9797	public  function  getExAppFolder (string  $ appIdstring  {
98- 		$ appsPaths$ this config ->getSystemValue ('apps_paths ' );
99- 		$ existingPath'' ;
100- 		foreach  ($ appsPathsas  $ appPath
101- 			if  ($ appPath'writable ' ] && file_exists ($ appPath'path ' ] . '/ '  . $ appId
102- 				$ existingPath$ appPath'path ' ] . '/ '  . $ appId
103- 			}
104- 		}
105- 		if  (!empty ($ existingPath
106- 			return  $ existingPath
107- 		}
98+ 		$ appsPaths$ this config ->getSystemValue ('apps_paths ' , []);
10899		foreach  ($ appsPathsas  $ appPath
109100			if  ($ appPath'writable ' ]) {
110- 				if  (mkdir ($ appPath'path ' ] . '/ '  . $ appId
111- 					return  $ appPath'path ' ] . '/ '  . $ appId
101+ 				$ fullAppPath$ appPath'path ' ] . '/ '  . $ appId
102+ 				if  (is_dir ($ fullAppPathmkdir ($ fullAppPath
103+ 					return  $ fullAppPath
112104				}
113105			}
114106		}
107+ 		// Fallback to default ExApp folder 
108+ 		$ defaultExAppFolderOC ::$ SERVERROOT '/apps/ '  . $ appId
109+ 		if  (is_dir ($ defaultExAppFolder
110+ 			return  $ defaultExAppFolder
111+ 		}
115112		return  null ;
116113	}
117114
118115	public  function  removeExAppFolder (string  $ appIdvoid  {
119- 		foreach  ($ this config ->getSystemValue ('apps_paths ' , []) as  $ appPath
120- 			if  ($ appPath'writable ' ]) {
121- 				if  (file_exists ($ appPath'path ' ] . '/ '  . $ appId
122- 					$ this rmdirr ($ appPath'path ' ] . '/ '  . $ appId
123- 				}
116+ 		$ appsPaths$ this config ->getSystemValue ('apps_paths ' , []);
117+ 		if  (empty ($ appsPaths
118+ 			// fallback check of default ExApp folder 
119+ 			$ defaultExAppFolderOC ::$ SERVERROOT '/apps/ '  . $ appId
120+ 			if  (is_dir ($ defaultExAppFolder
121+ 				$ this rmdirr ($ defaultExAppFolder
122+ 			}
123+ 			return ;
124+ 		}
125+ 		foreach  ($ appsPathsas  $ appPath
126+ 			if  ($ appPath'writable ' ] && is_dir ($ appPath'path ' ] . '/ '  . $ appId
127+ 				$ this rmdirr ($ appPath'path ' ] . '/ '  . $ appId
124128			}
125129		}
126130	}
0 commit comments