after upgrading to Commerce Core 8.x-2.36 this module doesn't work

Created on 2 June 2023, about 1 year ago
Updated 16 January 2024, 5 months ago

Problem/Motivation

Add item to cart and either a blank screen appears or a site is having problems type error occurs.
Log message:
TypeError: Drupal\commerce_cart_flyout\EventSubscriber\CartEventSubscriber::__construct(): Argument #3 ($route_match) must be of type Drupal\Core\Routing\RouteMatchInterface, Drupal\Core\Entity\EntityTypeManager given, called in /home/runnersp/public_html/site/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 259 in Drupal\commerce_cart_flyout\EventSubscriber\CartEventSubscriber->__construct() (line 34 of /home/dir/public_html/site/web/modules/contrib/commerce_cart_flyout/src/EventSubscriber/CartEventSubscriber.php)

Steps to reproduce

This occurred after upgrading to Commerce Core 8.x-2.36 from Commerce Core 8.x-2.35.
Site is on Drupal core 9.5.9.
So upgrade to 2.36, and then try to add something to cart, and error appears.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Closed: duplicate

Version

1.0

Component

Code

Created by

🇺🇸United States djween

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

Merge Requests

Comments & Activities

  • Issue created by @djween
  • Status changed to Needs review about 1 year ago
  • 🇮🇳India KarthickAcsh_R coimbatore

    A argument missing in the "CartEventSubscriber", Updated in the patch.

  • 🇫🇷France Toki Caen, Normandy

    This is a critical issue in my opinion since no one can order because of that (I got the exact same issue with wsod).
    I have just patched the module with #2 (but without the use on line 8 since there is already a call to EntityTypeManager) and it seems OK now.

  • 🇫🇷France Toki Caen, Normandy
  • 🇨🇦Canada simgui8 Canada

    Thanks, I have met this issue too and #2 works for me.

    I was wondering about the "use" keyword when extending classes.
    After digging on this it seems that the "use" keyword is per file basis and not inherited.
    (information found at SO, corroborated at php.net).

  • 🇫🇷France Toki Caen, Normandy

    My mistake, I have edited manually the file on PHPStorm.
    After adding the modifications line 31, use lines have been added automatically.
    With my manual add on EntityTypeManager, I got an error message on drush about an "use" already done.
    So the patch is completely fine!

  • 🇺🇸United States dobe

    Just ran into this on a production site. #2 resolved my issue! Thank you!

  • Status changed to RTBC 12 months ago
  • thank you for the patch. it applies cleanly to version 1.9 and resolves this issue. marking as RTBC.

  • 🇩🇪Germany mericone

    Thank you for this valuable patch. You might have to replace template files, if you use your own theme, otherwise you might not see any output at all.

  • 🇫🇷France ratjaune

    Nice patch. Thank you !

  • 🇬🇧United Kingdom guy_schneerson

    Tested with:

  • Core: 9.5.10
  • Commerce: 8.x-2.36
  • The merge request !12 by @simgui8 works and is essential for working with the latest version of commerce CommerceCartEventSubscriber and should ideally be committed for supporting a smother Drupal 10 upgrade path.

    For anyone needing to get their site ready beforehand, you can add it as a patch to your composer.json

            "patches": {
                "drupal/commerce_cart_flyout": {
                    "after upgrading to Commerce Core 8.x-2.36 this module doesn't work": "https://git.drupalcode.org/project/commerce_cart_flyout/-/merge_requests/12.patch"
            }
                }
  • 🇳🇱Netherlands Neograph734 Netherlands

    This patch no longer applied for me. It appears that the same changes have now been made in the pull request in 📌 Drupal 10 support Needs work . (But my cart still does not load...)

  • First commit to issue fork.
  • 🇦🇺Australia ELC

    The $messenger and $entityTypeManager properties are defined and set in the parent CommerceCartEventSubscriber, hence the
    parent::__construct($messenger, $string_translation, $entity_type_manager);
    No need for ST trait when TranslationInterface already injected, plus it's a parent issue.

    This change has been included in 📌 Drupal 10 support Needs work .

    Cart not loading is some change inside flyout, in that issue. In D9, it still works with 8.x-1.9 + this commit.

  • 🇦🇺Australia ELC

    Cart block not loading seems fixed by

    • 7865eaed - Use jQuery syntax for once call in module.js
  • 🇩🇪Germany Hydra

    +1 RTBC

  • 🇩🇪Germany Anybody Porta Westfalica

    Should this perhaps better be closed as duplicate of 📌 Drupal 10 support Needs work which seems more complete?

  • Status changed to Closed: duplicate 5 months ago
  • 🇩🇪Germany Hydra

    It surly is. Haven't seen this since the D10 upgrade of the project I used this for is still tbd. So yeah thx Anybody, lets focus on the other issue. The patch works as a workaround and needs to be upgraded to the other issue anyways. So lets close this.

  • Production build 0.69.0 2024