Skip to content
Snippets Groups Projects
Commit 85090f1c authored by catch's avatar catch
Browse files

Issue #3189064 by Matroskeen, quietone, benjifisher: Migration sql source...

Issue #3189064 by Matroskeen, quietone, benjifisher: Migration sql source plugins can not be serialised because of reference to the database connection

(cherry picked from commit e2289f20)
parent 679e57fa
No related branches found
No related tags found
No related merge requests found
......@@ -461,4 +461,11 @@ protected function mapJoinable() {
return TRUE;
}
/**
* {@inheritdoc}
*/
public function __sleep() {
return array_diff(parent::__sleep(), ['database']);
}
}
......@@ -146,6 +146,15 @@ public function testGetDefinitions() {
}
Database::addConnectionInfo('migrate', 'default', $connection_info['default']);
// Make sure source plugins can be serialized.
foreach ($migration_plugins as $migration_plugin) {
$source_plugin = $migration_plugin->getSourcePlugin();
if ($source_plugin instanceof SqlBase) {
$source_plugin->getDatabase();
}
$this->assertNotEmpty(serialize($source_plugin));
}
$migration_plugins = $this->container->get('plugin.manager.migration')->getDefinitions();
// All the plugins provided by core depend on migrate_drupal.
$this->assertNotEmpty($migration_plugins);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment