Reload styleEditor after updating image path
authorjoshuaruesweg <ruesweg@woltlab.com>
Fri, 11 Dec 2020 10:48:22 +0000 (11:48 +0100)
committerjoshuaruesweg <ruesweg@woltlab.com>
Fri, 11 Dec 2020 10:54:49 +0000 (11:54 +0100)
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

index 7158e8781f3cfdce2849d8d7f0459f155d8f8668..e8cc533f4146563c5ea89d3ed6d6f175779ab3d6 100644 (file)
@@ -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) {