From 06701166ca7dab9e73175eae509e63612e61aabe Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Thu, 5 Jul 2012 19:48:04 +0200 Subject: [PATCH] Work-around for template guessing if accessing *Edit page --- wcfsetup/install/files/lib/page/AbstractPage.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wcfsetup/install/files/lib/page/AbstractPage.class.php b/wcfsetup/install/files/lib/page/AbstractPage.class.php index 31ca7ca9e0..53c9231255 100644 --- a/wcfsetup/install/files/lib/page/AbstractPage.class.php +++ b/wcfsetup/install/files/lib/page/AbstractPage.class.php @@ -151,6 +151,12 @@ abstract class AbstractPage implements IPage { if (empty($this->templateName)) { $classParts = explode('\\', get_class($this)); $className = preg_replace('~(Form|Page)$~', '', array_pop($classParts)); + + // check if this an *Edit page and use the add-template instead + if (substr($className, -4) == 'Edit') { + $className = substr($className, 0, -4) . 'Add'; + } + $this->templateName = lcfirst($className); } -- 2.20.1