Fall back to the Vanilla palette when the current palette is missing

This commit is contained in:
Jeremy Ruston
2026-07-22 17:11:02 +01:00
parent 73ad4f633b
commit d5f8a04230
3 changed files with 26 additions and 2 deletions
+1 -1
View File
@@ -81,7 +81,7 @@ tags: $:/tags/Macro
\procedure actions-recompile-current-palette()
\procedure tv-action-refresh-policy() always
<$transclude $variable="actions-compile-palette" inputPalette={{$:/palette}} outputPalette="$:/temp/palette-colours"/>
<$transclude $variable="actions-compile-palette" inputPalette={{{ [{$:/palette}!is[missing]] :else[[$:/palettes/Vanilla]] }}} outputPalette="$:/temp/palette-colours"/>
\end actions-recompile-current-palette
\procedure tv-palette-name() $:/temp/palette-colours
@@ -0,0 +1,24 @@
title: Operators/Palettes/MissingPaletteFallback
description: A missing current palette falls back to Vanilla
type: text/vnd.tiddlywiki-multiple
tags: [[$:/tags/wiki-test-spec]]
title: Output
\import [subfilter{$:/core/config/GlobalImportFilter}]
(<<colour background>>)
(<<colour foreground>>)
+
title: Actions
\import [subfilter{$:/core/config/GlobalImportFilter}]
<<actions-recompile-current-palette>>
+
title: $:/palette
$:/palettes/DoesNotExist
+
title: ExpectedResult
<p>(#ffffff)
(#333333)</p>
@@ -8,4 +8,4 @@ impact-type: compatibility-break
Before v5.5.0, the following palettes shipped as shadow tiddlers in the core: Blanca, Blue, ~BrightMute, ~ContrastDark, ~ContrastLight, ~CupertinoDark, ~DarkPhotos, ~DesertSand, ~FlexokiDark, ~FlexokiLight, ~GruvBoxDark, Nord, Rocker, ~SolarFlare, ~SolarizedDark, ~SolarizedLight, ~SpartanDay, ~SpartanNight and Twilight. From v5.5.0 onwards they are provided by the Legacy Palettes plugin instead.
A wiki that uses one of these palettes without having customised it will render without palette colours after upgrading. To restore the palette, install the Legacy Palettes plugin from the official plugin library, or choose a different palette in the control panel. A palette that has been customised is stored in the wiki itself, and is unaffected by the upgrade.
A wiki that uses one of these palettes without having customised it will fall back to the default Vanilla palette after upgrading. To restore the palette, install the Legacy Palettes plugin from the official plugin library, or choose a different palette in the control panel. A palette that has been customised is stored in the wiki itself, and is unaffected by the upgrade.