1. Obey the instructions and disable your contrib that provides a node type.
  2. Upgrade.
  3. Observe the lost body.
  4. Panic.
CommentFileSizeAuthor
#20 body_up.patch12.96 KBchx
#16 body_up.patch8.55 KBchx
#2 body_up.patch8.48 KBchx

Comments

ctmattice1’s picture

Also to note #866410: node_update_7006() relies on has_body

Found this out the hard way.

chx’s picture

Status: Active » Needs review
StatusFileSize
new8.48 KB

This simple patch gets us ready there will be 1 exception due to taxonomy 7005, i can't help that there is an issue alreayd there for that. Also the "has_body" and the body_label information is simply not there. The contribs will need to take care of that. By the way this is another bug, as you disable your contribs you lose the customized body label but that's not this issue. I am adding a body label saying 'Upgraded body label' and then either the associated contrib can run a simple field_update_instance or let the user fix from field UI.

Status: Needs review » Needs work

The last submitted patch, body_up.patch, failed testing.

chx’s picture

Status: Needs work » Needs review

Still needs review, that exception does not belong to this one. It needs review, like what should be the label? Body? I used Upgraded body label but I am unsure.

bjaspan’s picture

I would say the body label should be "Body". That's what almost everyone uses so it will usually be right, and as you say they can fix it via the UI. If not "Body", my second choice would be "Body (upgraded)". But then a valid question would be why that node type has "upgraded" when all the others do not. So just "Body" is probably best, it will lead to the fewest support questions in the forums. :-)

The patch looks good to me. Should we wait for #706842: Improve comments for the taxonomy upgrade path to remove the failure? It isn't clear to me why the test fails here but not for currently committed HEAD; does no other test call $this->performUpgrade()?

plach’s picture

subscribe

chx’s picture

OK, Body it is and yes it's the 706842 that fails us. I will reroll once that's in.

jp.stacey’s picture

I'm aware that this bug is awaiting #706842: Improve comments for the taxonomy upgrade path but I'm at a loose end so I thought it might be useful to test with a concrete example.

I can repeat the original bug with image.module specifically. That's not a great choice given there might be confusion over images in core, but webform no longer owns its own nodes and I don't have much experience of any other content-type-creating modules!

Here's the steps to repeat:

  • D6:
    • Enable image module
    • Create image node with body
    • Disable image module
  • D7:
    • Run update.php
    • Navigate to image node
    • Body has disappeared

When I apply the patch in #2 the body content is transferred successfully and visible on the new site. However, when I navigate to the node edit page, I get an error:

Notice: Undefined index: image_node_form in drupal_retrieve_form() (line 690 of /var/www/drupal-7/includes/form.inc).
Warning: call_user_func_array(): First argument is expected to be a valid callback, 'image_node_form' was given in drupal_retrieve_form() (line 724 of /var/www/drupal-7/includes/form.inc).

The image content type is not available at admin/structure/types . I guess this is related to the fact that the content type also disappears in D6 when the image node is disabled, but does that error needs catching? It does also exist on the D6 node-edit page immediately after the image.module is first disabled:

warning: call_user_func_array(): First argument is expected to be a valid callback, 'image_node_form' was given in /var/www/drupal-6-upgrade/includes/form.inc on line 376.

so maybe this is working as designed? Seems a shame to have a broken site without a clear upgrade path for end users if that's the case.

damien tournoud’s picture

@jp.stacey: what you describe feels like as-designed. The image module is not there to handle this node in D7, so it's natural that things falls apart.

bjaspan’s picture

#706842: Improve comments for the taxonomy upgrade path is ready for what I think is its final review.

ctmattice1’s picture

patch in #2 works, will retry with #706842: Improve comments for the taxonomy upgrade path patch in place.

catch’s picture

#2: body_up.patch queued for re-testing.

catch’s picture

IMO the label should just be "Body" rather than "Upgraded body label" - that way people upgrading may not need to bother fixing at all if they left things as default. Looks great otherwise.

Status: Needs review » Needs work

The last submitted patch, body_up.patch, failed testing.

tstoeckler’s picture

+++ modules/simpletest/tests/upgrade/upgrade.node_body.test	2010-08-23 16:15:08 +0000
@@ -0,0 +1,32 @@
+ * Upgrade test for node boeis.

Typo.

Also, concerning the body label can we not simply do #13 (just "Body") and then provide a message on the finished upgrade? Something like (but more elaborate): "The labels of the body fields on your content types have all been renamed to "Body". You will need to manually edit them if you used differing labels."

Powered by Dreditor.

chx’s picture

Status: Needs work » Needs review
StatusFileSize
new8.55 KB

Rerolled w body as label.

catch’s picture

Status: Needs review » Reviewed & tested by the community

Can't see anything else to complain about, RTBC now.

catch’s picture

Issue tags: +D7 upgrade path
dries’s picture

Status: Reviewed & tested by the community » Needs work

1. Can we name the test file upgrade.node.test or something, and group all node system related tests in one file? Let's do a quick re-roll of this.

2.

+++ modules/simpletest/tests/upgrade/upgrade.node_body.test	2010-09-07 06:22:40 +0000
@@ -0,0 +1,32 @@
+    $this->drupalGet("content/1263769200");

...

+++ scripts/generate-d6-content.sh	2010-09-07 06:18:39 +0000
@@ -185,3 +185,24 @@ for ($i = 0; $i < 12; $i++) {
+node_save($node);
+path_set_alias("node/$node->nid", "content/$node->created");

It is not clear why sometimes we use a constant, and other times we compute the URL.

Looks RTBC otherwise.

chx’s picture

Status: Needs work » Reviewed & tested by the community
StatusFileSize
new12.96 KB

Yes sir. These were trivial to fix.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Since those were Dries's only complaints, committed to HEAD. Thanks a lot for snuffing this one... how nasty.

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

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