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.

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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

RgnYLDZ created an issue. See original summary.

J.’s picture

Same question.

shivam_tiwari made their first commit to this issue’s fork.

codebymikey’s picture

Title: Drupal 10 compatibility » Drupal 10 support
Issue summary: View changes
Related issues: +#3327925: Missing bcmath PHP extension for projects extending Drupal Commerce
codebymikey’s picture

J.’s picture

Status: Active » Needs review
FileSize
6.24 KB

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.

RgnYLDZ’s picture

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?

rsnyd’s picture

@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);
   }
 
   /**
rsnyd’s picture

FileSize
5.12 KB

Attempting a patch based on upgrade_status suggestions.

J.’s picture

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

andreylugovtsov made their first commit to this issue’s fork.

o_timoshchuk’s picture

Version: 8.x-2.x-dev » 8.x-2.0-beta1
Status: Needs review » Reviewed & tested by the community

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’s picture

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.

newaytech’s picture

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?

sagesolutions’s picture

+1 for having a new release with D10 supported!

rsnyd’s picture

+1 for having a new release with D10 supported!

newaytech’s picture

For anyone else landing here - for what it's worth - I rewrote a few GTM triggers and am now using the Google Tag module (the new version now supports GTM - and has a pretty good ecomm dataLayer). 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.

jcmartinez’s picture

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’s picture

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
leymannx’s picture

Version: 8.x-2.0-beta1 » 8.x-2.x-dev
Category: Feature request » Task
Status: Reviewed & tested by the community » Needs work
manojbisht_drupal’s picture

Status: Needs work » Needs review
FileSize
7.54 KB

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

manojbisht_drupal’s picture

Rewriting patch after removing test case