Fixed
Project:
Commerce Core
Version:
4.x-dev
Component:
Commerce
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
23 Nov 2026 at 14:08 UTC
Updated:
23 Nov 2026 at 15:37 UTC
Jump to comment: Most recent
Commerce 4.x still has 154 procedural functions marked #[LegacyHook] across its 24 .module files. They forward to the OOP hook classes and only exist for Drupal core versions before 11.1. Since #3638817: Require Drupal ^11.1 and PHP ^8.3 on 4.x, test against Drupal 12 in CI, 4.x requires Drupal ^11.1 (now ^11.5), so they're dead code.
They weren't part of #3638819: Remove code deprecated for removal in commerce:4.0.0. They were never @deprecated; they're a compatibility layer for older core versions.
#[LegacyHook] stubs.template_preprocess_* functions to initial preprocess callbacks (Drupal 11.2+)..module files that end up empty, and review whatever else is left in the others (constants, helpers).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 #3
jsacksick commentedRemoved all
#[LegacyHook]stubs, plus thetemplate_preprocess_*wrappers (every theme hook already definesinitial preprocess, so core never called them).commerce_alter_inline_forms(), an unused wrapper aroundCommerceHooks::alterInlineForms().commerce_get_entity_display(),_commerce_entity_theme_suggestions(), the order address field helpers,commerce_product_add_body_field(), etc.). Moving those to services can be a separate follow-up.commerce_promotion_post_update_1()calledcommerce_promotion_entity_base_field_info(); it now callsCommercePromotionHooks::entityBaseFieldInfo().*.services.ymlfiles. Core (11.1+) registers#[Hook]classes as autowired services keyed by class name.Comment #5
jsacksick commented