Procházet zdrojové kódy

Selection of variants broken for users on default theme

Signed-off-by: emanuele <[email protected]>
emanuele před 11 roky
rodič
revize
f65722305c
2 změnil soubory, kde provedl 2 přidání a 1 odebrání
  1. 1 0
      Sources/Themes.php
  2. 1 1
      Themes/default/Themes.template.php

+ 1 - 0
Sources/Themes.php

@@ -957,6 +957,7 @@ function PickTheme()
 		'url' => $scripturl . '?action=theme;sa=pick;u=' . (!empty($_REQUEST['u']) ? (int) $_REQUEST['u'] : 0),
 		'name' => $txt['theme_pick'],
 	);
+	$context['default_theme_id'] = $modSettings['theme_default'];
 
 	$_SESSION['id_theme'] = 0;
 

+ 1 - 1
Themes/default/Themes.template.php

@@ -718,7 +718,7 @@ function template_pick()
 			function changeVariant', $theme['id'], '(sVariant)
 			{
 				document.getElementById(\'theme_thumb_', $theme['id'], '\').src = oThumbnails', $theme['id'], '[sVariant];
-				document.getElementById(\'theme_use_', $theme['id'], '\').href = sBaseUseUrl', $theme['id'], ' + \';vrt=\' + sVariant;
+				document.getElementById(\'theme_use_', $theme['id'], '\').href = sBaseUseUrl', $theme['id'] == 0 ? $context['default_theme_id'] : $theme['id'], ' + \';vrt=\' + sVariant;
 				document.getElementById(\'theme_thumb_preview_', $theme['id'], '\').href = sBasePreviewUrl', $theme['id'], ' + \';vrt=\' + sVariant + \';variant=\' + sVariant;
 				document.getElementById(\'theme_preview_', $theme['id'], '\').href = sBasePreviewUrl', $theme['id'], ' + \';vrt=\' + sVariant + \';variant=\' + sVariant;
 			}