From 9e1bac25cf08703dea7f281c070fbc8c0f5d478e Mon Sep 17 00:00:00 2001 From: Torben Lundsgaard Date: Wed, 8 May 2024 07:38:01 +0200 Subject: [PATCH] Fix addon setting --- src/Installation/Upgrade.php | 15 +++++++++++++++ src/Options.php | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/Installation/Upgrade.php b/src/Installation/Upgrade.php index abb0358..309b1f9 100644 --- a/src/Installation/Upgrade.php +++ b/src/Installation/Upgrade.php @@ -43,6 +43,7 @@ protected function get_upgrades(): array { '1.14' => 'v114_upgrade', '1.15' => 'v115_upgrade', '1.20' => 'v120_upgrade', + '1.22' => 'v122_upgrade', ]; $current_version = \get_option( 'gtmkit_version' ); @@ -138,4 +139,18 @@ protected function v120_upgrade(): void { Options::init()->set( $values, false, false ); } + + /** + * Upgrade routine for v1.20 + */ + protected function v122_upgrade(): void { + + $values = [ + 'premium' => [ + 'addon_installed' => false, + ], + ]; + + Options::init()->set( $values, false, false ); + } } diff --git a/src/Options.php b/src/Options.php index a1657a2..cd34668 100644 --- a/src/Options.php +++ b/src/Options.php @@ -92,7 +92,7 @@ final class Options { ], 'premium' => [ 'addon_installed' => [ - 'default' => true, + 'default' => false, 'type' => 'boolean', ], ],