From e4ddadba8cda2d1ba7d50f8daa5a3644dff1979c Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Mon, 16 Dec 2013 21:26:24 +0100 Subject: [PATCH] Fixes packageDir property of template objects Fixes #1593 --- .../files/lib/data/template/Template.class.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/data/template/Template.class.php b/wcfsetup/install/files/lib/data/template/Template.class.php index 2e4d9643e4..f830404756 100644 --- a/wcfsetup/install/files/lib/data/template/Template.class.php +++ b/wcfsetup/install/files/lib/data/template/Template.class.php @@ -1,6 +1,8 @@ execute(array($id)); $row = $statement->fetchArray(); + // get relative directory of the template the application + // belongs to + if ($row['application'] != 'wcf') { + $application = ApplicationHandler::getInstance()->getApplication($row['application']); + } + else { + $application = ApplicationHandler::getInstance()->getWCF(); + } + $row['packageDir'] = PackageCache::getInstance()->getPackage($application->packageID)->packageDir; + // enforce data type 'array' if ($row === false) $row = array(); } -- 2.20.1