Update Drupal/Commerce version dependency

Created on 14 March 2025, 3 months ago

Problem/Motivation

Drupal Commerce released version 3.0.0 in Jan 2025. We should update the Commerce Cart Advanced dependency.

Steps to reproduce

Proposed resolution

I will update the dependency and see if I experience any breakage.

Remaining tasks

MR coming soon!

User interface changes

Nada

API changes

Unknown yet!

Data model changes

Hopefully none!

πŸ“Œ Task
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States scottsawyer Atlanta

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @scottsawyer
  • πŸ‡ΊπŸ‡ΈUnited States scottsawyer Atlanta

    Ok, first hitch:

    The service "commerce_cart_advanced.hook.cart_item_form_alter" has a dependency on a non-existent service "commerce_pri
    ce.number_formatter_factory". Did you mean one of these: "commerce_price.number_format_repository", "commerce_price.num
    ber_formatter"?

    This is used in Drupal\commerce_cart_advanced\Hook\CartItemFormAlter. Checking into the replacement https://www.drupal.org/node/2975672 β†’ .

  • πŸ‡ΊπŸ‡ΈUnited States scottsawyer Atlanta

    The merge request is working on my local. Please test and let me know.

  • πŸ‡ΊπŸ‡ΈUnited States scottsawyer Atlanta

    I just updated Drupal Commerce to 3.0.1, which introduces autowiring for the CartProvider, and breaks our AdvancedCartProvider.

    The fix, thanks to the friendly folks on Slack, is to change the way CommerceCartAdvancedServiceProvider::alter method adds the database service.

    Before:

    $definition->addArgument(new Reference('database'));
    

    to

    $definition->setArgument('$database_connection', new Reference('database'));
    
  • πŸ‡ΊπŸ‡ΈUnited States scottsawyer Atlanta

    Looks like it's working for me!

  • Status changed to Needs work 14 days ago
  • πŸ‡ΊπŸ‡ΈUnited States scottsawyer Atlanta

    Commerce 3.0.2 adds a return type to Drupal\commerce_cart\Plugin\Block\CartBlock::build(): array. Need to update
    Drupal\commerce_cart_advanced\Plugin\Block\CurrentCartBlock::build()

  • πŸ‡ΊπŸ‡ΈUnited States scottsawyer Atlanta

    Working for me!

  • πŸ‡ΊπŸ‡ΈUnited States scottsawyer Atlanta

    Per https://www.drupal.org/node/3517855 β†’

    If you have subclassed the cart block and overridden the getCartViews() method, this method has been moved to the new service class: CartLazyBuilders.

    Maybe we should extend this class and point the generatePlaceholder LazyBuilder to the new service rather than swapping the service entirely to keep this functionality contained within the module to reduce the chance of side effects?

Production build 0.71.5 2024