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
When migrating a node of type page, the UID does not get set during the migration. On a Drupal 6 site I have a node where the the uid is set to some number greater than 1. When migrating the node the migrated copy gets a UID of 1 instead of the same value as the D6 site. The user I am using as my test case exists in both systems and the UID is the same in both cases.
It seems this can happen if an admin creates a node and sets the author to someone.
Proposed resolution
Remaining tasks
User interface changes
API changes
Comment | File | Size | Author |
---|---|---|---|
#14 | interdiff.txt | 563 bytes | benjy |
#14 | 2281591-14.patch | 1.67 KB | benjy |
#12 | drupal-author-information-test-dumps-2281591-12.patch | 1.58 KB | Anonymous (not verified) |
#9 | drupal-author-information-test-dumps-2281591-9.patch | 1.72 KB | Anonymous (not verified) |
#8 | drupal-author-information-does-not-migrate-over-2281591-8.patch | 1.32 KB | Anonymous (not verified) |
Comments
Comment #1
vendion CreditAttribution: vendion commentedComment #2
ultimikeComment #3
ultimike@vendion,
If you ran this test using the D6Manifest-Node.yml file, then users were not migrated, only nodes. You can retest this by combining the .yml from #2224001: Manual testing (D6->D8): User and User Profile with the D6Manifest-Node.yml and I think you'll have better luck.
Let me know.
Thanks,
-mike
Comment #4
benjy CreditAttribution: benjy commentedI tested this with the following manifest file and still had the error reported in the issue. @ultimike, did you have this work at some point?
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedThis is still an issue, even with both manifests merged.
Comment #6
Anonymous (not verified) CreditAttribution: Anonymous commentedI tracked down the source of the error and I have rolled a patch.
It seems in D6 that if User 1 creates a post and specifies another user as author of that node (let's say uid = 3) in the database it will be:
node.uid = 3
node_revisions.uid = 1
So this was previously working if the user authored the content themself, but D6 will only display what is in the node table, completely ignoring what is in the node_revisions table. Thus, I have moved the UID mapping from node_revisions to node table.
Comment #8
Anonymous (not verified) CreditAttribution: Anonymous commentedReroll: Test should no longer expect to see uid returned from node_revisions query.
Comment #9
Anonymous (not verified) CreditAttribution: Anonymous commentedThis patch affects only the test dumps, adding uid to the node context.
Comment #11
chx CreditAttribution: chx commentedComment #12
Anonymous (not verified) CreditAttribution: Anonymous commentedUpdated per chx's comments... tests are still going to fail though (passes in phpunit, fails in simpletest). I've finally got my head wrapped around most of the testing things but I'm on client projects for the next few days if someone else wants to pick this up, please do. :)
My suspicion is that since we are trying to test for a different uid in node and node_revisions tables, that the NodeRevision tests need to deal with uid = 2 somehow. Feedback welcome. Feeling like I'm close figuring this out but just short on time...
Comment #14
benjy CreditAttribution: benjy commentedThere was a fatal error in the creation of the tables so i've re-rolled the patch and fixed that once issue. Lets see what the bot says now.
Comment #15
chx CreditAttribution: chx commentedDrupal 6, ouch! Thanks for fixing this.
Comment #16
webchickCommitted and pushed to 8.x. Thanks!