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.
Currently, any class extending MigrateContentParser() has no knowledge of the item id of the data being parsed--only its content. For debugging purposes, it would be helpful to know the source item id. This can be accomplished by passing it to the setContent() method. Patch forthcoming.
Comment | File | Size | Author |
---|---|---|---|
#3 | 2505683.3.migrate.pass-ids-to-content-parser.patch | 3.63 KB | joachim |
#1 | pass_item_id_to_chunk-2505683-1.patch | 1.74 KB | grasmash |
Comments
Comment #1
grasmash CreditAttribution: grasmash at Acquia for U.S. Department of Justice commentedComment #2
mikeryanLet's default $item_id to NULL, for the sake of any existing implementors out there that will break on the required argument.
Please declare the item_id member variable. Extra credit for filling in a missing docblock or three!
Comment #3
joachim CreditAttribution: joachim commentedI think it would be clearer to pass as the ID the bit that goes before the MIGRATE_CHUNK_SEPARATOR in the overall ID. That way everything is working with the same kinds of IDs. The parser shouldn't need to reconstitute a file URI, as it has the file contents to work with.
Docblocks as requested :)
Comment #4
mikeryanCommitted, thanks!