diff --git a/lib/Config/Changelog.php b/lib/Config/Changelog.php index 29b33f2e55..1bf9fbfb4f 100644 --- a/lib/Config/Changelog.php +++ b/lib/Config/Changelog.php @@ -1,15 +1,11 @@ access_control = $access_control; - } - function init() { $doing_ajax = (bool)(defined('DOING_AJAX') && DOING_AJAX); @@ -37,7 +33,7 @@ class Changelog { $version = Setting::getValue('version', null); $redirect_url = null; - $mp2_migrator = new MP2Migrator($this->access_control); + $mp2_migrator = new MP2Migrator(); if(!in_array($_GET['page'], array('mailpoet-migration', 'mailpoet-settings')) && $mp2_migrator->isMigrationStartedAndNotCompleted()) { // Force the redirection if the migration has started but is not completed $redirect_url = admin_url('admin.php?page=mailpoet-migration'); diff --git a/lib/Config/Initializer.php b/lib/Config/Initializer.php index cc0d7541e8..1c42cdb7e5 100644 --- a/lib/Config/Initializer.php +++ b/lib/Config/Initializer.php @@ -195,7 +195,7 @@ class Initializer { } function setupChangelog() { - $changelog = new Changelog($this->access_control); + $changelog = new Changelog(); $changelog->init(); } diff --git a/lib/Config/MP2Migrator.php b/lib/Config/MP2Migrator.php index e75fc6b8c5..9ef7fed8c6 100644 --- a/lib/Config/MP2Migrator.php +++ b/lib/Config/MP2Migrator.php @@ -19,19 +19,17 @@ class MP2Migrator { const CHUNK_SIZE = 10; // To import the data by batch private $log_file; - private $access_control; public $log_file_url; public $progressbar; private $segments_mapping = array(); // Mapping between old and new segment IDs private $wp_users_segment; - public function __construct(AccessControl $access_control) { + public function __construct() { $this->defineMP2Tables(); $log_filename = 'mp2migration.log'; $this->log_file = Env::$temp_path . '/' . $log_filename; $this->log_file_url = Env::$temp_url . '/' . $log_filename; $this->progressbar = new ProgressBar('mp2migration'); - $this->access_control = $access_control; } private function defineMP2Tables() { @@ -189,7 +187,7 @@ class MP2Migrator { * */ private function eraseMP3Data() { - $activator = new Activator($this->access_control); + $activator = new Activator(); $activator->deactivate(); $activator->activate();