Closed (fixed)
Project:
Drupal core
Version:
11.x-dev
Component:
node system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
24 Jun 2025 at 01:27 UTC
Updated:
27 Aug 2025 at 05:08 UTC
Jump to comment: Most recent
https://git.drupalcode.org/project/drupal/-/blob/11.x/core/modules/node/...
This is a procedural function in node.module that can be deprecated in favour of an OOP API.
N/A
Replace with a new function from #2699835: Add a method to ContentEntityBase for getting its Bundle entity chained with ->label()
Postponed on #2699835: Add a method to ContentEntityBase for getting its Bundle entity
Deprecate + replace usages of node_get_type_label
node_get_type_label is deprecated
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
acbramley commentedComment #3
acbramley commentedComment #4
acbramley commentedComment #6
acbramley commentedComment #7
berdirMissing the @trigger_error()?
Comment #8
acbramley commentedwoops!
Comment #9
berdirThe change looks good.
I'm unsure about the D12 deprecation, while it's trivial and not used a lot, the suggested replacement requires 11.3. I'd suggest we expand the change record, mention that getBundleEntity is 11.3+ and suggest using $node->get('type')->entity->label() as an alternative which is fully backwards compatible and then we'll see if core maintainers are OK with that.
Comment #10
acbramley commentedBut the deprecation is also in 11.3, but I see where you're coming from for modules supporting both 11.3 and 11.2.
I've updated the CR.
Comment #11
smustgrave commentedCR reads fine and a good deprecation. Not sure what else to review..
Comment #12
catchI checked contrib and found 10-20 modules using this (three pages on gitlab search).
#3518671: [policy, no patch] Defer disruptive 11.3 deprecations for removal until 13.0 probably means this should be deprecated for removal in 13.0 - it's borderline given there's an 11.2 way to do this, but if we defer the deprecation to 13.x then modules that want to support 11.2 and 12.0.0 betas at the same time can ignore the change and do it once (to the new, new way) when they drop 11.2 support instead of twice.
Comment #13
acbramley commentedUpdated deprecation messages, back to RTBC since this is a trivial change.
Comment #14
catchCommitted/pushed to 11.x, thanks!
Comment #16
catchComment #17
catch