Installed version - 7.x-1.2-rc1+6-dev

After inserting the google code id in the form of GTM-XXXXXXX (7 characters) I get an error message:

A valid environment ID is case sensitive and formatted like env-x.

Can not use the module

Comments

taitai created an issue. See original summary.

  • solotandem committed 8e6437f on 7.x-1.x
    Issue #2847738: Require 'include_environment' before validating '...
solotandem’s picture

Assigned: Unassigned » solotandem
Status: Active » Fixed

Thanks for reporting this. Grab the dev release tomorrow or pull the commit today, and try it.

BTW, the error is not about the container ID, but the environment ID (advanced tab, visible after checking 'Include an environment'). If you are not on a production site, then check the box and enter a value. You may also need to declare the environment in your GTM settings.

solotandem’s picture

Version: 7.x-1.2-rc1 » 7.x-1.2-rc2

This is an rc2 issue (which is same as rc1+6-dev, but less clear).

solotandem’s picture

Title: Trying to insert Google ID results in Error message » Form validates 'environment_id' even though 'include_environment' is not checked
taitai’s picture

I have tried your latest version 7.x-1.2-rc2+1-dev

You can now enter the google code id

However, the code id is not showing in the page source
src="//www.googletagmanager.com/ns.html?id="

I don't know if this required a new issue

taitai’s picture

Status: Fixed » Needs work
solotandem’s picture

Status: Needs work » Fixed

This issue is done; please create another issue for your current topic. Please mark it a support request unless you can prove the cause being a bug in this module, as I cannot reproduce what you report.

davon97’s picture

This appears to still be an issue as of the latest downloadable release (google_tag 7.x-1.2-rc2). I am getting the same error as described in this ticket and am unable to use the module as well.

solotandem’s picture

Please provide some details to support your claims; otherwise this is in a 'cannot reproduce' state. Is a new issue more appropriate?

davon97’s picture

FYI, for anyone following along. The issue above has been resolved in the latest commit. To grab the latest commit I ran the following:

git clone git://git.drupal.org/project/google_tag.git

This code is working for me now.

asauterChicago’s picture

Can confirm this issue still persist in the latest 7.x-1.2-rc2+1-dev version.

Steps to reproduce:

1. Install module.

2. Go to admin/config/system/google_tag

3. Attempt to save your GTM container id.

4. Get error: "A valid environment ID is case sensitive and formatted like env-x."

This module is unusable for now.

Edit: Please note the stable 7x-1.1 version works just fine.

asauterChicago’s picture

Status: Fixed » Needs work
solotandem’s picture

Please review the code on your site (confirm it has the revision you mention) and provide some evidence for your claim (e.g. where is the code failing, what 'relevant' modules [not all of them please] you have enabled and which release); i am in agreement with davon97 that this is fixed; i.e. cannot reproduce.

asauterChicago’s picture

> where is the code failing, what 'relevant' modules [not all of them please] you have enabled and which release)

I'm not sure what you mean. Your code is failing in your form validation somewhere. I'm not setting an environmental variable in any other place The only other google contrib module I have enabled is google analytics, which also does not set a $values['google_tag_include_environment'].

However, if you wish, I can open an xdebug console and debug some breakpoints. I'll paste my findings back here.

solotandem’s picture

Do you have enabled variable or variable_realm, i18n, etc?

solotandem’s picture

Status: Needs work » Fixed

I suspect you are running 1.2-rc2 not 1.2-rc2+1 as claimed.

By evidence, I am asking you to back up your claim that the "code is failing in your form validation somewhere." Where, under what conditions, etc.? The error message you refer to is wrapped in a conditional that requires "$include_environment" to be set before the message could possibly be displayed. Based on what you have reported, my guess would be that you checked this box and submitted the form, in the absence of any evidence to the contrary.

I just tested the settings form again with and without modules like variable_realm being enabled; it works fine. If you desire to continue this discussion, please start a new issue and tag it a 'support request' unless you can provide evidence for your claim of a bug.

Chris Burge’s picture

I can confirm that the error exists in 7.x-1.2-rc2 but is resolved in 7.x-1.2-rc2+1.

intrafusion’s picture

This issue may be fixed, but please do something about the homepage:
Prefer the 1.2-rc2 release over the 1.1 release as it fixes some bugs in the 1.1 release and adds features. It is not shown below due to 'stable' releases being preferred over 'unstable' releases.

Please roll a 1.2-rc3 release and update the project homepage.

solotandem’s picture

I agree with you about making an rc3 release, but was deferring until more commits and/or user feedback. At this point, am waiting for feedback on #2848738: Enhance support for stream wrappers.

For anyone reading this issue and using the 7.x-1.2-rc2 release, contrary to the claim in comment 12 that "this module is unusable for now," simply do the following (to workaround the bug documented in this issue):

  • visit the module settings page
  • click on advanced tab
  • check the 'Include an environment' box
  • enter a bogus environment id, e.g. 'env-1'
  • uncheck the 'Include an environment' box
  • click 'Save configuration' button

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

solotandem’s picture

solotandem’s picture

icf-vpathak’s picture

I was facing the same issue. The process mentioned in comment number 20 helped.
Thanks, Solotandem!