It seems to me the definition of the $node_example array is wrong in node_example.install. It uses a key 'body_label' which according to the documentation of node_type_set_defaults does not exist:
$node_example = array(
'type' = > 'node_example',
'name' => $t('Example Node'),
'base' => 'node_content',
'description' => $t('This is an example node type with a few fields.'),
'body_label' => $t('Example Description'),
);
Probably this should be
'title_label' => $t('Example Description'),
(Body label can be set with node_add_body_field($content_type,$t('Example Description )), I think)
Comments
Comment #1
rfayThanks! Looking forward to your patch.
Comment #2
Jef-DS commentedI've changed the code to set the body label in a proper way. I've also added an alternative way (commented out) to set the label on the body instance. I hope this makes it a bit more clear.
Since this is the first Drupal patch I submit, I hope it works out OK. If I have done something wrong or haven't followed the proper procedures, I am always open to suggestions.
Comment #3
rfayWell, it passes the testbot! Could you please check and see if this has proper test coverage? Thanks for your first patch!
Comment #4
Jef-DS commentedThe body label was not tested (obviously).
I don't really know how to test this, so I've tried with a get request and checking whether the text 'Example Description' was present. But if you've got any pointers on how to test this more properly, I would be much obliged. Because this test looks rather weird to me.
Comment #5
Jef-DS commentedI've 'patched' the patch a bit. Instead of using assertText, I'm using assertRaw to test for the presence of the body label. But if anybody has a better idea, feel free to comment.
Comment #7
Jef-DS commented#4: body-label-1175288-4.patch queued for re-testing.
Comment #8
Jef-DS commentedSo it seems my latest patch breaks the comment block tests. I guess I'll have to look into that...
Comment #9
Jef-DS commented#4: body-label-1175288-4.patch queued for re-testing.
Comment #10
Jef-DS commented#5: body-label-1175288-5.patch queued for re-testing.
Comment #11
cyberswat commentedlet's poke the bot a bit
Comment #12
cyberswat commentedComment #13
rfay#5: body-label-1175288-5.patch queued for re-testing.
Comment #15
rfayReroll of #5 to current.
Comment #17
rfayExcept that I messed up of course. Another reroll of #5
Comment #18
rfayAnd rerolled again after the doxygen patch went in...
Comment #19
rfayIf this is OK, please RTBC it and let's get it in before we all forget what it was about.
Comment #20
rfay#18: examples.node_example_body_label_1175288_18.patch queued for re-testing.
Comment #21
rfay@cyberswat, @Jef-DS if you'll just confirm, let's commit.
Comment #22
Jef-DS commentedIt's OK by me. Do I have to do anything else to confirm this?
Comment #23
rfayIf you have reviewed the code and tested the patch, just say what you've done and set it to RTBC. Thanks!
Comment #24
Jef-DS commented@rfay. I'm not sure about this, but since I'm the one who filed the patch in the first place, I don't think I'm the proper person to RTBC it. Or am I mistaken? (I would feel more comfortable anyway when a more experienced developer would take a look at it, especially as far as the testing code is concerned)
Comment #25
rfayYou're RTBC'ing my rerolls... That's generally considered OK.
I think you may be the "more experienced developer" here, but would love for @cyberswat to chime in too. There are pretty weird and obscure things.
Comment #26
cyberswat commentedLooks good .. thanks!
Comment #27
rfayThanks so much!
Committed to D7: http://drupalcode.org/project/examples.git/commitdiff/4370a37
D8: http://drupalcode.org/project/examples.git/commitdiff/50ea176