- Issue created by @rgnyldz
- First commit to issue fork.
- Status changed to Needs review
over 1 year ago 6:50pm 12 May 2023 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.
- First commit to issue fork.
- Status changed to RTBC
over 1 year ago 1:21pm 4 July 2023 - 🇺🇦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?
- 🇬🇧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... → .
- Add the Composer lenient plugin:
composer require mglaman/composer-drupal-lenient
- Allow lenient magic for commerce_google_tag_manager:
composer config --merge --json extra.drupal-lenient.allowed-list '["drupal/commerce_google_tag_manager"]'
- 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.
- composer install
- Add the Composer lenient plugin:
- Status changed to Needs work
about 1 year ago 2:43pm 7 December 2023 - leymannx Berlin
Looks like there are still a few more problems: https://dev.acquia.com/drupal10/deprecation_status/projects/commerce_goo...
- Status changed to Needs review
about 1 year ago 5:41pm 19 December 2023 - 🇮🇳India manojbisht_drupal
Adding the patch, as it is dependent on google_tag 2.0.