Closed (fixed)
Project:
Google Tag
Version:
7.x-2.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
18 Dec 2019 at 10:19 UTC
Updated:
29 Jan 2021 at 13:05 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
preethi_warrier commentedComment #3
preethi_warrier commentedComment #4
alexpottThinking about this again - I'm not sure that doing the directory creation in hook_requirements on install is correct. I think the directory creation should happen in google_tag_enable() as hook_requirements runs before a module is installed.
That said the fix in #2 looks like it will work.
Note all you have to do is make the requirement hook do nothing on install because \GTMContainerManager::createAssets() is already called from google_tag_enable() and that will create the directory if necessary - and also output messages if it fails.
Comment #5
alexpottAlso I'd change
if ($phase == 'runtime' || $phase == 'update' || $phase == 'install') {to
if ($phase == 'runtime') {There's no need for this to prevent updating your site if it fails.
Which means you could change the requirements hook to:
As there's less conditionals and indentation and the intentions of the implementation are easier to grok. You can also lose the
$t = get_t()as that is not necessary.Comment #6
preethi_warrier commentedComment #7
preethi_warrier commentedComment #9
solotandem commentedThanks for reporting this.
A more interesting question at this point is, "How exactly did the tests pass if this was a blocker to the install?"
Comment #11
sarahwbs commentedIs this actually fixed?
Comment #12
alphex commentedUmm, nope.
I just DRUSH DL
Project google_tag (7.x-2.x-dev) downloaded to /app/sites/all/modules/contrib/google_tag. [success]
And I'm still getting the error.
Error: Class 'GTMSettings' not found in google_tag_requirements() (line 91 of /app/sites/all/modules/contrib/google_tag/google_tag.install).
Comment #13
solotandem commented@alphex If you can provide repeatable steps AND demonstrate where and how the code in this module generates the error, then start a new issue and provide the details. Include your OS and PHP version.
@sarahwbs Ditto.
I installed 7.x-2.x from command line using drush and from the UI; no errors in either case.
Comment #14
sdelplanque commentedI got the error and found the solution.
Only updaters (not fresh install of the module) are involved.
You just have to flush the cache after replacing the old version files of the module.
The Google Tag Manager .info file has new files referenced :
files[] = includes/entity/container.inc
files[] = includes/entity/manager.inc
files[] = includes/entity/manager_interface.inc
files[] = includes/entity/settings.inc
Without flushing cache, if your module is already installed, the updater can't find them.
A good old
drush cc allfix the problem.Comment #15
chrisgross commentedClearing the cache did not work for me (or did not work alone), but running database updates did.
drush updbshould do it since you can't get to update.php via the UI due to the error. A patch still may be needed, but you should always run db updates after upgrading a module.Comment #16
mindaugasd commentedCreated new issue for this https://www.drupal.org/project/google_tag/issues/3195381