From e32485ce3abad0c664cfdda26b4d98fd98e9aa62 Mon Sep 17 00:00:00 2001 From: joshuaruesweg Date: Fri, 11 Dec 2020 11:48:22 +0100 Subject: [PATCH] Reload styleEditor after updating image path Because the style is compiled after the variables have been set, we have to reload the style object once with the correct `imagePath` so that it can be used correctly in the initial compilation. --- wcfsetup/install/files/lib/data/style/StyleEditor.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/wcfsetup/install/files/lib/data/style/StyleEditor.class.php b/wcfsetup/install/files/lib/data/style/StyleEditor.class.php index 7158e8781f..e8cc533f41 100644 --- a/wcfsetup/install/files/lib/data/style/StyleEditor.class.php +++ b/wcfsetup/install/files/lib/data/style/StyleEditor.class.php @@ -1089,6 +1089,7 @@ class StyleEditor extends DatabaseObjectEditor implements IEditableCachedObject $styleEditor->update([ 'imagePath' => FileUtil::getRelativePath(WCF_DIR, $style->getAssetPath()), ]); + $styleEditor = new StyleEditor(new Style($style->styleID)); // save variables if ($variables !== null) { -- 2.20.1