Commit 2dc81b7a authored by Michael Iseard's avatar Michael Iseard
Browse files

Add check for versions less than 2.0.4 to migrate campaign labels from transactions

parent 41eb20e9
......@@ -26,9 +26,12 @@ class ActivatorService {
/**
* Runs all activation functions
*
* @param $old_version
* @since 1.0.0
*/
public static function activate() {
public static function activate($old_version = null) {
$logger = new LoggerService();
LoggerService::init();
TwigService::initCache();
......@@ -37,7 +40,12 @@ class ActivatorService {
self::create_subscriptions_table();
self::set_defaults();
$logger = new LoggerService();
if ( $old_version && version_compare($old_version, '2.0.4', '<' ) ) {
$logger->info('Upgrading to version 2.0.4', ['previous_version' => $old_version]);
$result = UpdateService::sync_campaign_labels();
if($result) $logger->info('Updated campaign labels from transactions');
}
$logger->info( 'Kudos Donations plugin activated' );
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment