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

Files: 
CommentFileSizeAuthor
#14 interdiff.txt563 bytesbenjy
#14 2281591-14.patch1.67 KBbenjy
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 77,297 pass(es). View
#12 drupal-author-information-test-dumps-2281591-12.patch1.58 KBRyan Weal
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] 72,490 pass(es), 8 fail(s), and 9 exception(s). View
#9 drupal-author-information-test-dumps-2281591-9.patch1.72 KBRyan Weal
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] 72,669 pass(es), 7 fail(s), and 8 exception(s). View
#8 drupal-author-information-does-not-migrate-over-2281591-8.patch1.32 KBRyan Weal
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 73,207 pass(es). View
#6 drupal-author-information-does-not-migrate-over-2281591-6.patch566 bytesRyan Weal
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] 73,198 pass(es), 1 fail(s), and 0 exception(s). View

Comments

vendion’s picture

ultimike’s picture

ultimike’s picture

@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

benjy’s picture

I 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?

- d6_user
- d6_user_profile_field
- d6_user_profile_field_instance
- d6_user_profile_entity_display
- d6_user_profile_entity_form_display
- d6_profile_values:user
- d6_filter_format
- d6_user_role
- d6_user_picture_entity_display
- d6_user_picture_entity_form_display
- d6_user_picture_file
- d6_user_picture_field
- d6_user_picture_field_instance

- d6_node
- d6_node_revision
- d6_node_type
- d6_view_modes
- d6_filter_format
- d6_field_instance_per_form_display
- d6_field_instance_widget_settings
- d6_field_formatter_settings
- d6_field_instance
- d6_field
- d6_field_settings
- d6_node_settings
- d6_cck_field_values:*
- d6_cck_field_revision:*
Ryan Weal’s picture

This is still an issue, even with both manifests merged.

Ryan Weal’s picture

Status: Active » Needs review
FileSize
566 bytes
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] 73,198 pass(es), 1 fail(s), and 0 exception(s). View

I 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.

Status: Needs review » Needs work
Ryan Weal’s picture

Status: Needs work » Needs review
FileSize
1.32 KB
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 73,207 pass(es). View

Reroll: Test should no longer expect to see uid returned from node_revisions query.

Ryan Weal’s picture

FileSize
1.72 KB
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] 72,669 pass(es), 7 fail(s), and 8 exception(s). View

This patch affects only the test dumps, adding uid to the node context.

Status: Needs review » Needs work

The last submitted patch, 9: drupal-author-information-test-dumps-2281591-9.patch, failed testing.

chx’s picture

Issue summary: View changes
Ryan Weal’s picture

Status: Needs work » Needs review
FileSize
1.58 KB
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] 72,490 pass(es), 8 fail(s), and 9 exception(s). View

Updated 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...

Status: Needs review » Needs work

The last submitted patch, 12: drupal-author-information-test-dumps-2281591-12.patch, failed testing.

benjy’s picture

Status: Needs work » Needs review
FileSize
1.67 KB
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 77,297 pass(es). View
563 bytes

There 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.

chx’s picture

Status: Needs review » Reviewed & tested by the community

Drupal 6, ouch! Thanks for fixing this.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 8.x. Thanks!

  • webchick committed bf7e5e2 on 8.0.x
    Issue #2281591 by benjy, Ryan Weal, vendion: Author information does not...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.