Problem/Motivation
I am migrating a Drupal 7 site that has locations attached to 6 content types:
MariaDB [drupal7]> select name from variable where name like 'location_settings_node_%';
+------------------------------------+
| name |
+------------------------------------+
| location_settings_node_article |
| location_settings_node_distributor |
| location_settings_node_download |
| location_settings_node_page |
| location_settings_node_product |
| location_settings_node_webform |
+------------------------------------+
6 rows in set (0.000 sec)
This shows up as 6 items in migrate status:
$ ddev exec drush ms upgrade_d7_entity_location_field_node
----------------------------------------- --------------------------------------- -------- ------- ---------- ------------- ---------------
Group Migration ID Status Total Imported Unprocessed Last Imported
----------------------------------------- --------------------------------------- -------- ------- ---------- ------------- ---------------
Import from Drupal 7 (migrate_drupal_7) upgrade_d7_entity_location_field_node Idle 6 0 6
----------------------------------------- --------------------------------------- -------- ------- ---------- ------------- ---------------
However, on running this migration only two items are migrated, and this means the subsequent migrations cannot run because they think this one has not completed:
$ ddev exec drush mim upgrade_d7_entity_location_field_node
[notice] Processed 2 items (2 created, 0 updated, 0 failed, 0 ignored) - done with 'upgrade_d7_entity_location_field_node'
$ ddev exec drush ms upgrade_d7_entity_location_field_node
----------------------------------------- --------------------------------------- -------- ------- ---------- ------------- ---------------------
Group Migration ID Status Total Imported Unprocessed Last Imported
----------------------------------------- --------------------------------------- -------- ------- ---------- ------------- ---------------------
Import from Drupal 7 (migrate_drupal_7) upgrade_d7_entity_location_field_node Idle 6 2 4 2021-01-13 21:33:08
----------------------------------------- --------------------------------------- -------- ------- ---------- ------------- ---------------------
$ ddev exec drush mim upgrade_d7_entity_location_field_instance_node_article
[error] Migration upgrade_d7_entity_location_field_instance_node_article did not meet the requirements. Missing migrations upgrade_d7_entity_location_field_node. requirements: upgrade_d7_entity_location_field_node.
Steps to reproduce
Proposed resolution
Override the EntityLocationFieldStorage::count() method so it returns the correct number of results.
Alternatively, override the ::query() method so it returns the correct data to begin with.
Remaining tasks
User interface changes
API changes
Data model changes