From: Tim Düsterhus Date: Mon, 20 Jul 2020 12:48:04 +0000 (+0200) Subject: Create asset path when creating a style X-Git-Tag: 5.3.0_Alpha_1~100^2~30 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2080b255f162bf8af66cd62795a05982df45e0e7;p=GitHub%2FWoltLab%2FWCF.git Create asset path when creating a style --- diff --git a/wcfsetup/install/files/lib/data/style/StyleEditor.class.php b/wcfsetup/install/files/lib/data/style/StyleEditor.class.php index c3a4c1fb70..c86e8bdd70 100644 --- a/wcfsetup/install/files/lib/data/style/StyleEditor.class.php +++ b/wcfsetup/install/files/lib/data/style/StyleEditor.class.php @@ -1059,6 +1059,13 @@ class StyleEditor extends DatabaseObjectEditor implements IEditableCachedObject $style = parent::create($parameters); $styleEditor = new StyleEditor($style); + // create asset path + FileUtil::makePath($style->getAssetPath()); + + $styleEditor->update([ + 'imagePath' => FileUtil::getRelativePath(WCF_DIR, $style->getAssetPath()), + ]); + // save variables if ($variables !== null) { $styleEditor->setVariables($variables);