Drupal 10 support

Created on 9 February 2023, almost 2 years ago
Updated 19 December 2023, 11 months ago

We're unable to get a Project Update Bot scan working on dev at the moment because of an upstream infrastructure issue ( #3327925: Missing bcmath PHP extension for projects extending Drupal Commerce ).

Drupal 10 support would need to be addressed manually until that issue is fixed upstream.

📌 Task
Status

Needs review

Version

2.0

Component

Code

Created by

🇹🇷Turkey rgnyldz

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

Merge Requests

Comments & Activities

  • Issue created by @rgnyldz
  • First commit to issue fork.
  • Status changed to Needs review over 1 year ago
  • Here's a patch for D10 compatability. I've manually tested in on 9.5 w/php8.1 and was able to send events to GTM. I had no problems manually testing it on D10 either.

  • 🇹🇷Turkey rgnyldz

    How can I test the module for D10? I cannot get it with composer. I like to test it.

    Or can we have a dev version?

  • 🇺🇸United States rsnyd

    @J.,
    Is this for 8.x-2.x-dev? I'm getting a .rej for the patch in #6.

    --- src/EventTrackerService.php
    +++ src/EventTrackerService.php
    @@ -238,7 +238,7 @@ class EventTrackerService {
     
         // Throw an event to add possible checkout step options by event listeners.
         $event = new TrackCheckoutStepEvent($step_index, $order);
    -    $this->eventDispatcher->dispatch(EnhancedEcommerceEvents::TRACK_CHECKOUT_STEP, $event);
    +    $this->eventDispatcher->dispatch($event, EnhancedEcommerceEvents::TRACK_CHECKOUT_STEP);
       }
     
       /**
  • 🇺🇸United States rsnyd

    Attempting a patch based on upgrade_status suggestions.

  • Yes it was for 8.x-2.x-dev.

  • First commit to issue fork.
  • Status changed to RTBC over 1 year ago
  • 🇺🇦Ukraine o_timoshchuk

    In D10 I installed "drupal/commerce_google_tag_manager": "^2.0@beta" and applied patch #6.
    I have tested the module and it is functioning properly.

  • @richgerdes opened merge request.
  • @richgerdes opened merge request.
  • 🇺🇸United States richgerdes New Jersey, USA

    The two above branches are functionally the same.

    https://git.drupalcode.org/issue/commerce_google_tag_manager-3340566/-/c...

    I think MR 7 follows the code standards a little closer, and probably should be the candidate merged.

  • 🇬🇧United Kingdom newaytech

    Thanks for the great module folks and support in bringing up to date for D10. Do we have an ETA for a new release with D10 support baked in?

  • 🇨🇦Canada sagesolutions

    +1 for having a new release with D10 supported!

  • 🇺🇸United States rsnyd

    +1 for having a new release with D10 supported!

  • 🇬🇧United Kingdom newaytech

    For anyone else landing here - for what it's worth - I rewrote a few GTM triggers and am now using the Google Tag module. I thought that updating the module with the versions numbers would work (thanks for the patch) - but the composer.json file looks at the GIT repo for compatibility.

  • 🇺🇸United States jcmartinez Raleigh, NC, USA

    After applying the patch #9, I got a WSOD with the following error message:

    The website encountered an unexpected error. Please try again later.
    TypeError: Drupal\commerce_google_tag_manager\EventSubscriber\CommerceEventsSubscriber::trackCartView(): Argument #1 ($event) must be of type Drupal\commerce_google_tag_manager\EventSubscriber\GetResponseEvent, Symfony\Component\HttpKernel\Event\RequestEvent given in Drupal\commerce_google_tag_manager\EventSubscriber\CommerceEventsSubscriber->trackCartView() (line 100 of modules/contrib/commerce_google_tag_manager/src/EventSubscriber/CommerceEventsSubscriber.php).
    Drupal\commerce_google_tag_manager\EventSubscriber\CommerceEventsSubscriber->trackCartView(Object, 'kernel.request', Object)
    call_user_func(Array, Object, 'kernel.request', Object) (Line: 142)
    Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.request') (Line: 145)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
    Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
    Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
    Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
    Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
    Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
    Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
    Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 718)
    Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
    
  • leymannx Berlin

    I thought that updating the module with the version numbers would work (thanks for the patch) - but the composer.json file looks at the GIT repo for compatibility.

    To tell Composer to not look at the package for compat you need to use the composer-lenient-plugin. See https://www.drupal.org/docs/develop/using-composer/using-drupals-lenient... .

    1. Add the Composer lenient plugin: composer require mglaman/composer-drupal-lenient
    2. Allow lenient magic for commerce_google_tag_manager: composer config --merge --json extra.drupal-lenient.allowed-list '["drupal/commerce_google_tag_manager"]'
    3. Add the patch from comment #6 to your composer.json patches section manually because this still can't be done from CLI and the patch from #9 is missing an important piece of code.
    4. composer install
  • Status changed to Needs work 11 months ago
  • Status changed to Needs review 11 months ago
  • 🇮🇳India manojbisht_drupal

    Adding the patch, as it is dependent on google_tag 2.0.

  • 🇮🇳India manojbisht_drupal

    Rewriting patch after removing test case

Production build 0.71.5 2024