STR:

- on a D6 site, create a node with multiple revisions
- unpublish the node
- upgrade to D7

Poof! The node body has disappeared from all but the current revision. It's not just hidden; the data is no longer in the database. Working on a fix + tests.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ksenzee’s picture

Status: Active » Needs review
FileSize
2.54 KB

Actually, I think it's even published node revisions that get lost in the upgrade. In the query that collected revision data, we were joining on vid instead of nid, which meant we only got current revisions. Patch with tests attached.

ksenzee’s picture

Issue tags: +D7 upgrade path
bjaspan’s picture

Yikes, I suspect this was my fault.

I don't have the time to think about it carefully at the moment, but I did at least notice that I think we're computing $total['sandbox'] wrong too:

    $query = db_select('node', 'n');
    $query->join('node_revision', 'nr', 'n.vid = nr.vid');
    $sandbox['total'] = $query->countQuery()->execute()->fetchField();

That will count only the number of nodes, not the number of node revisions, so the progress bar will be displayed incorrectly.

chx’s picture

Status: Needs review » Reviewed & tested by the community

That's one easy fix!

chx’s picture

Status: Reviewed & tested by the community » Needs work

Well, ksenzee fixed the bug and barry's is a different issue but i guess it belongs here,yes.

plach’s picture

sub

moshe weitzman’s picture

Status: Needs work » Needs review
FileSize
3.09 KB

Added fix for progress per barry's note.

Jody Lynn’s picture

I'm reviewing.

Jody Lynn’s picture

FileSize
3.13 KB

Patch looks good to me except I found a problem in the new Simpletest: in the upgrade simpletest database there are some revisions that legitimately do have empty bodies- the poll nodes. So I just adjusted the test to avoid the poll nodes. All other nodes have bodies.

moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community

Nice catch. Ready to fly.

webchick’s picture

Lift off!!

Committed to HEAD. NICE catch. That would've been highly unfortunate to have been found after beta. :)

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Edit: Sorry, janky wifi.

bjaspan’s picture

It seems to me the test should have been updated to check whether the original node had an empty body and then verify the new body based on whether it did, instead of hard-coding that in the current test data poll nodes have no body. I guess it will be fine until it causes some other test to fail, at which point it will be fixed.

webchick’s picture

Status: Fixed » Active

Aw, crap.

This (or something like it) resurfaced on the drupal.org D7 upgrade with project nodes. :( One last beta blocker...

Sergeant ksenzee is on the case!

ksenzee’s picture

Status: Active » Fixed

Apparently the bug that surfaced on the d.o upgrade is #895014: All fields of a node type are lost on module disable, and captain chx has it under control.

Status: Fixed » Closed (fixed)
Issue tags: -D7 upgrade path, -beta blocker

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