Docs say that title_label shouldn't need to be declared in hook_node_info(). Unfortunately an error is thrown if it isn't declared. Not sure if bug reports start in 6.x or 7.x, but I found it in Drupal 6.
Docs say that title_label shouldn't need to be declared in hook_node_info(). Unfortunately an error is thrown if it isn't declared. Not sure if bug reports start in 6.x or 7.x, but I found it in Drupal 6.
Comments
Comment #1
Susurrus commentedLooks like I missed another section where an error is thrown.
Comment #2
Susurrus commentedComment #3
damien tournoud commentedIt seems like you are somehow fixing a symptom, and not the real bug.
In
_node_type_set_defaults()there is some code to ensure sane default for node types. This function sets$type->title_labelif unset, but only if$type->has_titleis true.So I guess you are in the case where
$type->has_titleis false. After giving that some thoughts, I guess we should change the way_node_type_set_defaults()behaves. There is the same problem with$type->body_label.When that function will be fixed, I guess we could remove the
$type->body_labelcheck innode_type_save().Comment #4
damien tournoud commentedBack to code needs work, if you don't mind.
Comment #5
Susurrus commentedHere's an updated version that seems to fix this issue while setting the defaults in
_node_type_set_defaults(). I'm not sure how closely related these two issues are, but when the title is set to false, I'm still running into this problem: #265031: Not having title attribute on $node object throws errors when title not defined for content type.Comment #6
damien tournoud commentedThe patch in #5 looks good, but we need a better review from someone more familiar than me with that part of the code.
At first sight, the issue in #265031 does not seems to be closely related.
Comment #7
damien tournoud commentedBumping to D7, where the bug needs to be fixed before backporting to D6.
Comment #8
marcingy commentedBack to d6 as this code is no longer relevant in d7.