From bb5b2645c22c5d62f64289b842e9b60513432845 Mon Sep 17 00:00:00 2001 From: Simon Gilli <25326036+gilbertsoft@users.noreply.github.com> Date: Tue, 25 Oct 2022 12:02:20 +0200 Subject: [PATCH] Fix TYPO3 project detection to work with non existent symlinks, fixes #4326 --- pkg/ddevapp/typo3.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkg/ddevapp/typo3.go b/pkg/ddevapp/typo3.go index 75389678adb..f219d7026c0 100644 --- a/pkg/ddevapp/typo3.go +++ b/pkg/ddevapp/typo3.go @@ -152,9 +152,18 @@ func setTypo3SiteSettingsPaths(app *DdevApp) { // isTypoApp returns true if the app is of type typo3 func isTypo3App(app *DdevApp) bool { - if _, err := os.Stat(filepath.Join(app.AppRoot, app.Docroot, "typo3")); err == nil { + typo3Folder := filepath.Join(app.AppRoot, app.Docroot, "typo3") + + // Check if the folder exists, fails if a symlink target does not exist. + if _, err := os.Stat(typo3Folder); !os.IsNotExist(err) { return true } + + // Check if a symlink exists, succeeds even if the target does not exist. + if _, err := os.Lstat(typo3Folder); !os.IsNotExist(err) { + return true + } + return false }