Problem/Motivation

Drupal 11.1 added PHP attributes for entity types (#[ContentEntityType], #[ConfigEntityType]). All Commerce entity types still use annotations.

Postponed on #3638817: Require Drupal ^11.1 and PHP ^8.3 on 4.x, test against Drupal 12 in CI, which raises the 4.x minimum to Drupal 11.1.

Proposed resolution

Convert every entity type definition to attributes:

  • commerce_checkout: CheckoutFlow
  • commerce_log: Log
  • commerce_number_pattern: NumberPattern (+ EntityTestWithStore test entity)
  • commerce_order: Order, OrderItem, OrderType, OrderItemType
  • commerce_payment: Payment, PaymentGateway, PaymentMethod
  • commerce_price: Currency
  • commerce_product: Product, ProductType, ProductVariation, ProductVariationType, ProductAttribute, ProductAttributeValue
  • commerce_promotion: Promotion, Coupon
  • commerce_store: Store, StoreType
  • commerce_tax: TaxType

Can be split per submodule if the merge request gets too big to review.

Remaining tasks

  • Convert, confirm the pipeline is green.

User interface changes

None.

API changes

None. Entity type definitions are unchanged, only the way they are declared.

Data model changes

None.

Issue fork commerce-3638818

Command icon Show commands

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

jsacksick created an issue. See original summary.

jsacksick’s picture

Status: Postponed » Needs review

  • jsacksick committed 74b892eb on 4.x
    task: #3638818 Convert entity types to attributes
    
    By: jsacksick
    
jsacksick’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.