Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't setup event tracking or attempt any tracking if analytics provider is not on page #5523

Merged
merged 1 commit into from Mar 14, 2022

Conversation

cjcolvar
Copy link
Member

@cjcolvar cjcolvar commented Mar 11, 2022

This change fixes a bug when the page does not have an analytics provider setup. In
this scenario TrackingTags.analytics() assumes Google analytics and then errors because
_gaq is undefined. This error keeps all subsequent JS from executing. This causes the
refreshing of CSRF tokens on turbolinks:load not to run and many forms to raise
InvalidAuthenticityToken.

Fixes #5464 and #5470

@samvera/hyrax-code-reviewers

…der is not on page

This change fixes a bug when the page does not have an analytics provider setup.  In
this scenario TrackingTags.analytics() assumes Google analytics and then errors because
_gaq is undefined.  This error keeps all subsequent JS from executing.  This causes the
refreshing of CSRF tokens on turbolinks:load not to run and many forms to raise
InvalidAuthenticityToken.
Copy link
Contributor

@elrayle elrayle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. Thanks for making this more resilient!

@cudevmaxwell
Copy link
Contributor

This bug bit us, thanks very much for fixing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Editing Collection Type fails
3 participants