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.
Problem/Motivation
After see a few new issues about body content not being migrated I looked at MigrateNodeTest and didn't see a test for the migration of the node body.
Proposed resolution
Add tests for D6 and D7.
Remaining tasks
If needed, add data to dump files.
Write the tests, presumably in d7/MigrateNodeTest.php and d6/MigrateNodeTest
User interface changes
N/A
API changes
N/A
Data model changes
N/A
Comment | File | Size | Author |
---|---|---|---|
#12 | add_tests_for_node_body-2635242-12.patch | 875 bytes | alvar0hurtad0 |
#5 | 2635242-5.patch | 894 bytes | quietone |
| |||
#5 | interdiff-2635242-2-5.txt | 655 bytes | quietone |
#2 | 2635242-2.patch | 923 bytes | quietone |
|
Comments
Comment #2
quietone CreditAttribution: quietone commentedThere is a test for the node body value Drupal 6 migrations in d6/MigrateNodeTest.php. But there isn't a similar on for Drupal 7 migrations.
Drupal 7 MigrateNodeTest migrations test_content_type which does not have a body field. Adding a body field to that by the web interface caused a WSOD. Maybe time to work on #2578483: [meta] Keep dumps up-to-date and improve DX. An easier solution was to add a migration of the article type and test that.
Comment #3
quietone CreditAttribution: quietone commentedComment #4
snehi CreditAttribution: snehi as a volunteer and at Publicis Sapient for Publicis Sapient commentedi don't think this is the correct way to do it.
more than 80 col
Comment #5
quietone CreditAttribution: quietone commented@snehi, thx for the review.
1. What do you suggest? $node = Node::load(N) is used elsewhere in the file. I've just used what is already there.
2. Yes, it is long. And, in fact, I've just changed it to be consistent with other migration tests and in doing so it is even longer. See MigrateUserMailTest for an example.
Comment #6
quietone CreditAttribution: quietone commentedComment #7
chx CreditAttribution: chx commentedComment #8
alvar0hurtad0I think the problem is load the node directly by NID, IMHO we should get the id before and use a variable.
Comment #9
alvar0hurtad0Working on this.
Comment #11
alvar0hurtad0The patch don't apply.
Doing the reroll
Comment #12
alvar0hurtad0This is the reroll.
Comment #15
David Hernández CreditAttribution: David Hernández as a volunteer commentedThis seems ok to me.
Comment #16
catchCommitted/pushed to 8.1.x and cherry-picked to 8.0.x. Thanks!