summaryrefslogtreecommitdiffstatshomepage
path: root/core/modules/migrate/src
diff options
context:
space:
mode:
Diffstat (limited to 'core/modules/migrate/src')
-rw-r--r--core/modules/migrate/src/MigrateExecutable.php4
-rw-r--r--core/modules/migrate/src/Plugin/Discovery/AnnotatedClassDiscoveryAutomatedProviders.php2
-rw-r--r--core/modules/migrate/src/Plugin/migrate/destination/Config.php2
-rw-r--r--core/modules/migrate/src/Plugin/migrate/source/ConfigEntity.php3
-rw-r--r--core/modules/migrate/src/Plugin/migrate/source/SqlBase.php2
-rw-r--r--core/modules/migrate/src/Row.php26
6 files changed, 33 insertions, 6 deletions
diff --git a/core/modules/migrate/src/MigrateExecutable.php b/core/modules/migrate/src/MigrateExecutable.php
index a087ae6875e..2cf3a322351 100644
--- a/core/modules/migrate/src/MigrateExecutable.php
+++ b/core/modules/migrate/src/MigrateExecutable.php
@@ -106,7 +106,7 @@ class MigrateExecutable implements MigrateExecutableInterface {
$this->message = $message ?: new MigrateMessage();
$this->getIdMap()->setMessage($this->message);
$this->eventDispatcher = $event_dispatcher;
- // Record the memory limit in bytes
+ // Record the memory limit in bytes.
$limit = trim(ini_get('memory_limit'));
if ($limit == '-1') {
$this->memoryLimit = PHP_INT_MAX;
@@ -557,7 +557,7 @@ class MigrateExecutable implements MigrateExecutableInterface {
$usage = $this->attemptMemoryReclaim();
$pct_memory = $usage / $this->memoryLimit;
// Use a lower threshold - we don't want to be in a situation where we
- // keep coming back here and trimming a tiny amount
+ // keep coming back here and trimming a tiny amount.
if ($pct_memory > (0.90 * $threshold)) {
$this->message->display(
$this->t(
diff --git a/core/modules/migrate/src/Plugin/Discovery/AnnotatedClassDiscoveryAutomatedProviders.php b/core/modules/migrate/src/Plugin/Discovery/AnnotatedClassDiscoveryAutomatedProviders.php
index 9adf60b46ff..30cc28562e8 100644
--- a/core/modules/migrate/src/Plugin/Discovery/AnnotatedClassDiscoveryAutomatedProviders.php
+++ b/core/modules/migrate/src/Plugin/Discovery/AnnotatedClassDiscoveryAutomatedProviders.php
@@ -65,7 +65,7 @@ class AnnotatedClassDiscoveryAutomatedProviders extends AnnotatedClassDiscovery
if (isset($cached['id'])) {
// Explicitly unserialize this to create a new object
// instance.
- $definitions[$cached['id']] = unserialize($cached['content']);
+ $definitions[$cached['id']] = unserialize($cached['content'], ['allowed_classes' => FALSE]);
}
continue;
}
diff --git a/core/modules/migrate/src/Plugin/migrate/destination/Config.php b/core/modules/migrate/src/Plugin/migrate/destination/Config.php
index c77de935a52..2e6c26a1684 100644
--- a/core/modules/migrate/src/Plugin/migrate/destination/Config.php
+++ b/core/modules/migrate/src/Plugin/migrate/destination/Config.php
@@ -234,7 +234,7 @@ class Config extends DestinationBase implements ContainerFactoryPluginInterface,
return 'config_translation';
}
// Get the module handling this configuration object from the config_name,
- // which is of the form <module_name>.<configuration object name>
+ // which is of the form "<module_name>.<configuration object name>".
return !empty($this->configuration['config_name']) ? explode('.', $this->configuration['config_name'], 2)[0] : NULL;
}
diff --git a/core/modules/migrate/src/Plugin/migrate/source/ConfigEntity.php b/core/modules/migrate/src/Plugin/migrate/source/ConfigEntity.php
index dc70496282f..a5351c74862 100644
--- a/core/modules/migrate/src/Plugin/migrate/source/ConfigEntity.php
+++ b/core/modules/migrate/src/Plugin/migrate/source/ConfigEntity.php
@@ -71,7 +71,8 @@ class ConfigEntity extends SqlBase {
* {@inheritdoc}
*/
public function prepareRow(Row $row) {
- $row->setSourceProperty('data', unserialize($row->getSourceProperty('data')));
+ // @see \Drupal\Core\Config\DatabaseStorage::decode()
+ $row->setSourceProperty('data', unserialize($row->getSourceProperty('data'), ['allowed_classes' => FALSE]));
return parent::prepareRow($row);
}
diff --git a/core/modules/migrate/src/Plugin/migrate/source/SqlBase.php b/core/modules/migrate/src/Plugin/migrate/source/SqlBase.php
index 40dea1c7a2b..0aefdd99de2 100644
--- a/core/modules/migrate/src/Plugin/migrate/source/SqlBase.php
+++ b/core/modules/migrate/src/Plugin/migrate/source/SqlBase.php
@@ -424,7 +424,7 @@ abstract class SqlBase extends SourcePluginBase implements ContainerFactoryPlugi
}
// If we are tracking changes, we also need to retrieve all rows to compare
- // hashes
+ // hashes.
if ($this->trackChanges) {
return FALSE;
}
diff --git a/core/modules/migrate/src/Row.php b/core/modules/migrate/src/Row.php
index 3d961902bcd..2b5e8b2fb4e 100644
--- a/core/modules/migrate/src/Row.php
+++ b/core/modules/migrate/src/Row.php
@@ -267,6 +267,32 @@ class Row {
}
/**
+ * Tests if a property is an empty destination.
+ *
+ * @param string $property
+ * The name of the property.
+ *
+ * @return bool
+ * TRUE if the property is an empty destination.
+ */
+ public function hasEmptyDestinationProperty(string $property): bool {
+ return in_array($property, $this->emptyDestinationProperties);
+ }
+
+ /**
+ * Removes an empty destination property.
+ *
+ * @param string $property
+ * The name of the empty destination property.
+ */
+ public function removeEmptyDestinationProperty(string $property): void {
+ $this->emptyDestinationProperties = array_diff(
+ $this->emptyDestinationProperties,
+ [$property],
+ );
+ }
+
+ /**
* Returns the whole destination array.
*
* @return array