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

dnn.js not included on the page when cookie consent is enabled #2695

Closed
6 of 12 tasks
Mitjan11 opened this issue Apr 16, 2019 · 12 comments · Fixed by #4763
Closed
6 of 12 tasks

dnn.js not included on the page when cookie consent is enabled #2695

Mitjan11 opened this issue Apr 16, 2019 · 12 comments · Fixed by #4763

Comments

@Mitjan11
Copy link

Description of bug

The new cookie consent functionality released with DNN 9.3.1 depends on the window.dnn object being available which is created by dnn.js. However, when not using a skinobject that includes dnn.js on the page (or manually registering it), dnn.js is not included on the page and the cookie consent functionality breaks.

Relevant code:

$(window).on('load', function () {
    window.cookieconsentoptions = window.cookieconsentoptions || {};
    window.cookieconsentoptions.content = {
        message: window.dnn.getVar('cc_message'),
        dismiss: window.dnn.getVar('cc_dismiss'),
        link: window.dnn.getVar('cc_link')
    }
    if (window.dnn.getVar('cc_morelink') != '') {
        window.cookieconsentoptions.content.href = window.dnn.getVar('cc_morelink')
    }
	if (!window.cookieconsentoptions.palette) {
		window.cookieconsentoptions.palette = {
			"popup": {
      "background": "#000"
    },
    "button": {
      "background": "#f1d600"
    }
		}
	}
    window.cookieconsent.initialise(window.cookieconsentoptions);
});    

Our current short-term (as in, critical fix) workaround involves including the search skinobject on the page in a hidden div. Less than ideal of course.

Steps to reproduce

List the steps to reproduce the behavior:

  1. Create a simple empty page skin (no skinobjects that register dnn.js)
  2. Enable the cookie consent functionality
  3. Log out (dnn.js is loaded when logged in, into a SuperUser account anyway)
  4. Cookie consent message does not show

Current result

The cookie consent popup does not show.

Expected result

The cookie consent popup should show.

Screenshots

If applicable, provide screenshots to help explain your problem.
image

Error log

See above

Additional context

Add any other context about the bug that may be helpful for resolution.

Affected version

  • 9.3.1
  • 9.2.2
  • 9.2.1
  • 9.2
  • 9.1.1
  • 9.1
  • 9.0

Affected browser

  • Chrome
  • Firefox
  • Safari
  • Internet Explorer
  • Edge
@Tychodewaard
Copy link
Contributor

This is in 9.3.2 as well.

@Tychodewaard
Copy link
Contributor

@Mitjan11 Do you know of another workaround? Because on of the sites is using SearchBoost, so, the skinobject has already been replaced...
Should I register something like:
<dnn:DnnJsInclude runat="server" FilePath="js/dnn.js" ForceProvider="DnnFormBottomProvider" Priority="130" PathNameAlias="SkinPath" /> ?

@valadas
Copy link
Contributor

valadas commented Jul 29, 2019

@Tychodewaard I think you proposed workaround should work, I have not tried it though, but we need to fix this bug and have thecookie consent feature request that file to be included for sure.

@valadas valadas added this to the 9.4.1 milestone Jul 29, 2019
@valadas valadas modified the milestones: 9.4.1, 9.4.2 Sep 26, 2019
@valadas valadas modified the milestones: 9.4.2, 9.4.3 Nov 5, 2019
@valadas valadas modified the milestones: 9.4.3, 9.5.0 Nov 21, 2019
@yog-it
Copy link
Contributor

yog-it commented Dec 5, 2019

I had the same issue and your workaround fixes the issue by placing that line in the skin's .ascx file and removing PathNameAlias="SkinPath".

@valadas valadas modified the milestones: 9.5.0, 9.5.1 Jan 30, 2020
@valadas valadas modified the milestones: 9.5.1, 9.6.0 Mar 18, 2020
@valadas valadas modified the milestones: 9.6.0, 9.6.1 Apr 14, 2020
@valadas valadas modified the milestones: 9.6.1, 9.6.2 May 7, 2020
@david-poindexter david-poindexter added this to Awaiting Triage in Issue Triage via automation Jun 6, 2020
@david-poindexter david-poindexter moved this from Awaiting Triage to Bugs in Issue Triage Jun 6, 2020
@valadas valadas modified the milestones: 9.6.2, 9.7.0 Jun 25, 2020
@valadas valadas removed this from the 9.7.0 milestone Jul 28, 2020
@valadas
Copy link
Contributor

valadas commented Jul 28, 2020

Can no longer reproduce in 9.6.2 and I remember there was a PR merged about this.

@valadas valadas closed this as completed Jul 28, 2020
Issue Triage automation moved this from Bugs to Closed Jul 28, 2020
@trouble2
Copy link

image
This is DNN 9.9.0

@valadas valadas reopened this Mar 29, 2021
Issue Triage automation moved this from Closed to Awaiting Triage Mar 29, 2021
@valadas
Copy link
Contributor

valadas commented Mar 29, 2021

I reopened the issue but I did not test this out, does it happen to you on a simple clean install just by enabling cookie consent or is there more steps to make it happen ?

@trouble2
Copy link

trouble2 commented Mar 30, 2021

Yes, this is a clean DNN 9.9.0 with cookie consent enabled.
This site has got it's own skin, so perhaps xcillion by default includes the dnn.js I don't know...
We've used the workaround for now, but perhaps, when including the cookie consent it should also trigger the inclusion of dnn.js or include some code by itself to deal with the situation

@valadas
Copy link
Contributor

valadas commented Mar 30, 2021

Ok, thanks, I thought I had seen a PR to specifically fix this, guessed I dreamed about that. The issue is reopened. @donker does that ring a bell about being already fixed in a PR or am I just crazy?

@Tychodewaard
Copy link
Contributor

@valadas I think you were thinking of #4762

@valadas
Copy link
Contributor

valadas commented Sep 2, 2021

So it's resolved right ?

@bdukes
Copy link
Contributor

bdukes commented Sep 2, 2021

Yes, in 9.10.1

@bdukes bdukes closed this as completed Sep 2, 2021
Issue Triage automation moved this from Awaiting Triage to Closed Sep 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Issue Triage
  
Closed
Development

Successfully merging a pull request may close this issue.

5 participants