KaufmannDigital / KaufmannDigital.GDPR.CookieConsent

A ready-to-run package, that integrates an advanced cookie consent banner into your Neos CMS site.
https://www.kaufmann.digital/neos-cms/plugins/dsgvo-gdpr-cookie-consent
GNU General Public License v3.0
26 stars 11 forks source link

Support for multiple content dimensions #23

Closed beromir closed 3 years ago

beromir commented 3 years ago

Your package is really great and we would love to use it on our website, but there is a problem with our multilingual setup.

We have two languages registered as content dimensions in the settings.yaml:

Neos:
  ContentRepository:
      contentDimensions:
        language:
          label: 'Language'
          icon: icon-globe-europe
          default: de
          defaultPreset: de
          resolution:
            mode: 'topLevelDomain'
          presets:
            eu_EN:
              label: 'EU'
              values:
                - eu_EN
                - en_UK
              uriSegment: eu
            de:
              label: 'DE'
              values:
                - de
              uriSegment: de

We thought we could create the cookie consent page in either dimension/language. And it will recognize the dimension the user is in and it will display the cookie consent with the settings we have set for the dimension.

For example, we have different cookie consent texts on the German and English sites. But unfortunately, the cookie consent shows the text of the German dimension in all dimensions.

Is this already possible or is there a way to achieve this?

Nikdro commented 3 years ago

Thanks for your report!

We are using that package on customer-websites, which are also available in german and english. You expected correctly. It should use the CookieConsent from the right dimension and also use Fallback-Dimensions, if configured.

Just checked the difference between the language-configuration of our customers site and yours. They are looking almost the same, except from the 2 values in "eu_EN" of your example.

Can you provide some more information on that? Which Version of the package do you use? Which Version of Neos? Did you some debugging already?

beromir commented 3 years ago

We have tested it with NEOS v5.3 and v5.2.3 and v3.0.0 and v2.2.1 of the package. In all test cases the behaviour is the same. We have also tested it with a new NEOS installation and without the en_UK value in the settings.yaml, but without success.

Maybe the problem lies in the two lines here: https://github.com/KaufmannDigital/KaufmannDigital.GDPR.CookieConsent/blob/cca9abf1a7efeeb554f1b5a1ddd411c2dda296a3/Classes/Controller/ApiController.php#L52-L53 Because the $this has no information about the current dimension when we debugged it with Xdebug, but i have no idea why.

Nikdro commented 3 years ago

Ah, I see. Thanks for the information and your debugging!

That was part of a refactoring. Before v2.2, the banner was rendered directly in Fusion, where the dimension is included within the context by default. Starting with v2.2, we are loading the data via ajax, where dimensions are not given by default. So definitely a new bug.

I'll evaluate, how we can get the dimension-info here. Will keep you updated here within the next week, I think :innocent:

Nikdro commented 3 years ago

Bugfix is now released in 2.2.2 and 3.0.1.

I'm glad to hear your feedback.