While going through the examples to learn more about the Migrate concepts, I noticed that the migrate_plus.migration.beer_comment.yml file where the README refers to is missing. Further investigation revealed that the file was renamed to 'beer_comment.yml' and moved into the 'migrations' folder.
I see that the change was made in this commit:
http://cgit.drupalcode.org/migrate_plus/commit/?id=5d12af3d39bb6f6483d19...
Furthermore, the README does not explain why it is that 'beer_comment.yml' exists in a different folder. The README does say that in the 'migrations' folder 'hard-coded' migrations exist that do not need to be overridden, but it doesn't explain why this applies to the comments migration and not to the others.
I also see that in the UI (/admin/structure/migrate/manage/beer/migrations) the comment migration is not listed (probably because it is not editable?). When running drush ms
, the comment migration *is* listed. When running drush mi --group=beer
the comments do get created.
I'm trying to understand why the situation for comment is different.
For compatibility with Drupal 8.4.2 I'm using the dev versions of both Migrate Plus and Migrate Tools.
Comment | File | Size | Author |
---|---|---|---|
#2 | migrate_plus-comment-example-2926169-2.patch | 408 bytes | MegaChriz |
Comments
Comment #2
MegaChriz CreditAttribution: MegaChriz as a volunteer commentedThis at least fixes the reference, but the explanation of why the situation for comment is different is still missing. Therefore labeling this as 'Needs work'.
Comment #3
heddnComment #4
MegaChriz CreditAttribution: MegaChriz as a volunteer commented@heddn
I had labeled this as "Needs work", because I think my patch only fixes a part of the issue (see #2).
Comment #5
frederickjh@MegaChriz if the README.txt that you refering to is /migrate_example/README.txt, then it does explain why beer_comment.yml is in a different folder.
See points a. and b.
My guess is that the module developer wanted to give examples of both types of configuration files. Comments just happened to have gotten chosen to represent the a. point.
I think that this clears up why there are different directories, so a review of the code and this should be RTBC.
Comment #6
MegaChriz CreditAttribution: MegaChriz as a volunteer commented@frederickjh
Thanks for your reply. And yes, the README I'm refering to is indeed from /migrate_example/README.txt.
It explains that there can exist two different locations for migrations, but not why the case for comment is different. From the issue summary:
I've consulted other documentation about migration templates vs config entities (mostly from drupalize.me) and learned the following about them (correct me if I'm wrong):
If all of above is correct, then it still isn't clear to me why the case for comment is different. For example, the Migrate Example module does not define the comment entity type.
Is it because the migration for comment does not need to be overridden? Then why do the others ('beer_node', 'beer_term', 'beer_user') *do* need to be overridable? And why is it that the comment migration is listed when using the drush command 'ms', but not when using the UI?
Comment #7
marcvangendThanks for your summary, @MegaChriz. The README suggested that using migration templates (files in the /migrations directory) is the best option in my specific case, but your list convinced me otherwise.
Especially the fact that migration templates are not listed in the Migrate UI is a deal-breaker for me. Not because my migration exposes additional settings in the UI, but because it makes debugging much easier. I often set a breakpoint in a custom process plugin and then start the migration from the UI. Theoretically you could do the same from the command line, but our VM-based dev environment makes that much harder than debugging from the browser.
Comment #9
heddnThe original issue for this issue is addressed. If we want to improve docs or anything in the README, let's do that in follow-ups.