- Issue created by @benjifisher
- πΊπΈUnited States benjifisher Boston area
I am adding β¨ Allow a callback function for the Source path parameter Active as a related issue. I do not see an easy way to solve this problem with the proposed resolution from that issue, but maybe there is a way.
- πΊπΈUnited States benjifisher Boston area
MR 14 is a simple, 1-line change.
- πΊπΈUnited States benjifisher Boston area
I must have been doing something wrong, because the one-line change seemed to be working yesterday. On further testing, it does not.
The current MR adds an empty file (
empty.csv
) to the codebase. If thepath
is set to the specific string'/dev/null'
, then the constructor replaces that (in$this->configuration
) with the path to the empty file and also setsheader_offset
. The result is that the source plugin returns zero rows, without errors, warnings, nor exceptions.Other benefits.
With the feature branch, I can roll back a migration:
$ ddev drush mr import_csv_terms [notice] Rolled back 7 items - done with 'import_csv_terms' $ ddev drush ms import_csv_terms ------------------------- ------------------ -------- ------- ---------- ------------- --------------- --------------- Group Migration ID Status Total Imported Unprocessed Message Count Last Imported ------------------------- ------------------ -------- ------- ---------- ------------- --------------- --------------- Import CSV (import_csv) import_csv_terms Idle 0 0 0 0 ------------------------- ------------------ -------- ------- ---------- ------------- --------------- ---------------
With the 8.x-3.x branch, I cannot roll back a migration unless it specifies an actual path:
$ ddev drush mr import_csv_terms In UnavailableFeature.php line 40: stream does not support seeking. Failed to run drush mr import_csv_terms: exit status 1
With the feature branch, when I check the status of my migrations, I get this:
$ ddev drush ms ------------------------- ------------------ -------- ------- ---------- ------------- --------------- --------------------- Group Migration ID Status Total Imported Unprocessed Message Count Last Imported ------------------------- ------------------ -------- ------- ---------- ------------- --------------- --------------------- Import CSV (import_csv) import_csv_terms Idle 0 7 -7 0 2024-10-14 13:40:21 Import CSV (import_csv) import_csv_users Idle 0 3 -3 0 2024-10-14 13:40:21 Import CSV (import_csv) import_csv_nodes Idle 0 3 -3 0 2024-10-14 13:40:21 ------------------------- ------------------ -------- ------- ---------- ------------- --------------- ---------------------
With the 8.x-3.x branch, I get errors (but the same information):
$ ddev drush ms [error] Could not retrieve source count from import_csv_terms: stream does not support seeking. [error] Could not retrieve source count from import_csv_users: stream does not support seeking. [error] Could not retrieve source count from import_csv_nodes: stream does not support seeking. ------------------------- ------------------ -------- ------- ---------- ------------- --------------- --------------------- Group Migration ID Status Total Imported Unprocessed Message Count Last Imported ------------------------- ------------------ -------- ------- ---------- ------------- --------------- --------------------- Import CSV (import_csv) import_csv_terms Idle N/A 7 N/A 0 2024-10-14 13:40:21 Import CSV (import_csv) import_csv_users Idle N/A 3 N/A 0 2024-10-14 13:40:21 Import CSV (import_csv) import_csv_nodes Idle N/A 3 N/A 0 2024-10-14 13:40:21 ------------------------- ------------------ -------- ------- ---------- ------------- --------------- ---------------------
- First commit to issue fork.
- Issue was unassigned.
- Status changed to Needs review
about 2 months ago 3:25pm 27 December 2024 -
heddn β
committed 763ae41e on 8.x-3.x authored by
benjifisher β
Issue #3480434 by benjifisher, heddn: Allow /dev/null as the source path
-
heddn β
committed 763ae41e on 8.x-3.x authored by
benjifisher β
- heddn Nicaragua
Thanks for the contributions. This makes a lot of sense.
Automatically closed - issue fixed for 2 weeks with no activity.