Not compatible with latest version of Google Tag

Created on 8 March 2024, 9 months ago
Updated 11 March 2024, 9 months ago

Problem/Motivation

Hi !

This module (v1.0.3) is not compatible with latest Google Tag module (v2.0.x)
If both are installed and Tarte au citron Google Tag Manager submodule installed too, error is thrown on config page.

Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "google_tag.container_manager". in Drupal\Component\DependencyInjection\Container->get() (line 157 of core/lib/Drupal/Component/DependencyInjection/Container.php).
Drupal\tarte_au_citron_googletagmanager\Plugin\tarte_au_citron\GoogleTagManager::create(Object, Array, 'drupal_googletagmanager', Array) (Line: 21)
Drupal\Core\Plugin\Factory\ContainerFactory->createInstance('drupal_googletagmanager', Array) (Line: 83)
Drupal\Component\Plugin\PluginManagerBase->createInstance('drupal_googletagmanager', Array) (Line: 108)
Drupal\tarte_au_citron\ServicesManager->getServices() (Line: 188)
Drupal\tarte_au_citron\Form\ConfigurationForm->buildForm(Array, Object)
call_user_func_array(Array, Array) (Line: 536)
Drupal\Core\Form\FormBuilder->retrieveForm('tarte_au_citron_configuration_form', Object) (Line: 283)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 592)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
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: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

In 2.0.x versions of Google Tag, services have changed.
"google_tag.container_manager" doesn't exist anymore.

Steps to reproduce

Install tarte_au_citron
Install google_tag
Install tarte_au_citron_googletagmanager
Then go to /admin/config/tarte_au_citron/services

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇫🇷France Striknin Lyon

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

Comments & Activities

  • Issue created by @Striknin
  • 🇫🇷France klelostec

    Hi Striknin,

    Thanks for the issue.
    The actual submodule is only compatible with ^1.6 version of google_tag module (see composer.json in submodule).
    The tricky part is that composer doesn't take care of submodules composer requirements.

    In my opinion, the tarte_au_citron_googletagmanager submodule should be deprecated and a dedicated new module should be created.

    Could you help to create a version compatible with 2.x version of google_tag ?

Production build 0.71.5 2024