Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 295735

migrate_drupal's Variable source plugin always returns a row for processing, even if none of the variables for a migration are set on the source site

$
0
0

Problem/Motivation

Using the migrate_drupal module, I was trying to write a module that has a UI that shows total number of rows processed over the total number of actual rows in the source DB. For example, if I have 42 articles in my Drupal 7 site and I process 13 of them, it would have a textual display that shows: 13/42 rows processed.

As I was doing this, I discovered that the Variable source plugin will return 0 for the total count if the configured variables don't exist, but initializeIterator() will always return an iterator with 1 row. This leads to a weird case where my UI shows 1/0 rows processed, which is nonsensical.

Proposed resolution

Check if the source has rows and return an iterator created from an empty array if the count of source rows is 0

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

Not necessary.


Viewing all articles
Browse latest Browse all 295735

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>