Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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 CreditAttribution: Susurrus commentedLooks like I missed another section where an error is thrown.
Comment #2
Susurrus CreditAttribution: Susurrus commentedComment #3
Damien Tournoud CreditAttribution: 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_label
if unset, but only if$type->has_title
is true.So I guess you are in the case where
$type->has_title
is 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_label
check innode_type_save()
.Comment #4
Damien Tournoud CreditAttribution: Damien Tournoud commentedBack to code needs work, if you don't mind.
Comment #5
Susurrus CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: Damien Tournoud commentedBumping to D7, where the bug needs to be fixed before backporting to D6.
Comment #8
marcingy CreditAttribution: marcingy commentedBack to d6 as this code is no longer relevant in d7.