Skip to content

Commit

Permalink
Fix the default value for the custom CSS field
Browse files Browse the repository at this point in the history
  • Loading branch information
dtdesign committed Oct 12, 2023
1 parent a30e3d5 commit e16afcc
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0.1.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

/**
* Fixes the style variable value of `individualScssDarkMode`.
*
* @author Alexander Ebert
* @copyright 2001-2023 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
*/

use wcf\system\WCF;

// Fix the default value for style variables.
$sql = "UPDATE wcf1_style_variable
SET defaultValueDarkMode = ?
WHERE variableName = ?";
$statement = WCF::getDB()->prepare($sql);
$statement->execute([null, 'individualScssDarkMode']);

// Fixes any bad values stored for existing styles.
$sql = "UPDATE wcf1_style_variable_value
SET variableValueDarkMode = ?
WHERE variableID = (
SELECT variableID
FROM wcf1_style_variable
WHERE variableName = ?
)";
$statement = WCF::getDB()->prepare($sql);
$statement->execute([null, 'individualScssDarkMode']);

0 comments on commit e16afcc

Please sign in to comment.