You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
First-time CSV import validation messages do not show #930
Opening this as a follow-up to #924... because it is slightly different, and more complicated to fix.
As I was debugging #924 I came across this comment in our code for loading and displaying migration messages (eg: validation errors) after a CSV import:
// Migrate map tables are generated on-the-fly by the Drupal core migrate
// module, only when needed. If no rows get imported (due to validation
// errors, empty CSV files, etc), then the table will not be generated
// when this code runs.
This made me realize that this code will not work under certain conditions. Specifically, if this is the first time that a certain CSV importer is used, and validation fails, then the migrate_map_* table will not be created, and we will not be able to load the validation message.
Steps to reproduce:
Install farm_migrate_csv on a fresh farmOS instance.
Download the template for an Activity log CSV.
Only fill in the name column of the first row (leave timestamp blank so that validation fails).
Import the CSV.
Notice that the validation message is not shown.
This is a bit of a deep issue because the way we are loading the messages (after migration happens) relies on the migrate_map_* table existing, but Drupal core doesn't create that when no items are imported.
Activity
mstenta commentedon Feb 18, 2025
There are a few related upstream issues to be aware of:
Link to issue #930 from relevant code in CsvMigrationSubscriber.php.