The google_tag_post_update_move_advanced_settings function causes
[warning] Undefined variable $advanced_settings google_tag.post_update.php:19

This is because in the code:

foreach ($google_tags as $tag_container) {
    $gtm_tags = $tag_container->getGtmIds();
    foreach ($gtm_tags as $tag) {
      $advanced_settings['gtm'][$tag] = $tag_container->getGtmSettings();
    }
    $tag_container->set('advanced_settings', $advanced_settings);
    $tag_container->save();
  }

If the inner foreach for some reason does not have any iteration, then the $advanced_settings does not exist.

CommentFileSizeAuthor
#2 warning-fix-3471369-2.patch608 bytesnagy.balint

Issue fork google_tag-3471369

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:

Comments

nagy.balint created an issue. See original summary.

nagy.balint’s picture

Status: Active » Needs review
StatusFileSize
new608 bytes

Not sure if this is the right fix.

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

japerry’s picture

Status: Needs review » Fixed

This might be an issue for 8.x-1.x folks migrating, so it'd be useful to fix. Done!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • japerry committed 801f0319 on 2.0.x
    fix: #3471369 Fix the undefined variable and lost settings in the...

Status: Fixed » Closed (fixed)

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