Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I needed some minor fixes to get this plugin working with a wordpress source.
diff --git a/src/Plugin/migrate/source/MigrateXmlIterator.php b/src/Plugin/migrate/source/MigrateXmlIterator.php
index 807af4e..460629d 100644
--- a/src/Plugin/migrate/source/MigrateXmlIterator.php
+++ b/src/Plugin/migrate/source/MigrateXmlIterator.php
@@ -92,7 +92,7 @@ class MigrateXmlIterator implements \Iterator {
* The name of the MigrateXmlReader class.
*/
public function getReaderClassName() {
- return '\Drupal\migrate_plus\Plugin\migrate\source\MigrateXmlReader';
+ return '\Drupal\migrate_source_xml\Plugin\migrate\source\MigrateXmlReader';
}
/**
@@ -149,6 +149,13 @@ class MigrateXmlIterator implements \Iterator {
/**
* {@inheritdoc}
*/
+ public function count() {
+ return $this->xmlSource->computeCount();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
public function next() {
$this->currentElement = NULL;
$this->currentKey = NULL;
diff --git a/src/Plugin/migrate/source/XmlBase.php b/src/Plugin/migrate/source/XmlBase.php
index c75c683..87df3e6 100644
--- a/src/Plugin/migrate/source/XmlBase.php
+++ b/src/Plugin/migrate/source/XmlBase.php
@@ -75,7 +75,7 @@ abstract class XmlBase extends SourcePluginBase {
parent::__construct($configuration, $plugin_id, $plugin_definition, $migration);
if (empty($configuration['iterator_class'])) {
- $iterator_class = '\Drupal\migrate_plus\Plugin\migrate\source\MigrateXmlIterator';
+ $iterator_class = '\Drupal\migrate_source_xml\Plugin\migrate\source\\MigrateXmlIterator';
}
else {
$iterator_class = $configuration['iterator_class'];
Comment | File | Size | Author |
---|---|---|---|
#2 | migrate_source_xml-FixClassNamesAndCount-2639572-1.patch | 1.54 KB | digitaldonkey |
Comments
Comment #2
digitaldonkey CreditAttribution: digitaldonkey commentedComment #3
mkolar CreditAttribution: mkolar commentedThanks for the patch, Fixed my issue
Comment #4
jcnventura CreditAttribution: jcnventura at Wunder commentedThe module maintainer should definitively make the 'refactor' branch official and stop having everyone submitting patches to the different versions in use.
Comment #6
mikeryanCommitted, thanks.