Coder Social home page Coder Social logo

mindshape-gmbh / mindshape_cookie_consent Goto Github PK

View Code? Open in Web Editor NEW
10.0 10.0 13.0 736 KB

This extension provides functionality to create a customizable cookie consent for your website. It is developed for flexibility to be customized in accordance to your data security guidelines.

PHP 74.49% HTML 11.08% JavaScript 11.01% SCSS 3.42%
consent cookie extension typo3

mindshape_cookie_consent's People

Contributors

can0199 avatar featdd avatar websitedeveloper avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

mindshape_cookie_consent's Issues

PHP Warning: Undefined array key "site" in `Classes/UserFunc/ConfigurationTcaUserFunc.php` line 46 with TYPO3 12.4.10

Hi,

after switching from TYPO3 version 12.4.9 to 12.4.10 we get a TypeError in the backend when using the list view.

I think the problem is, that the passed $parameters changed with the new version. $parameters['row'] does not contain the site and sys_language_uid anymore. Instead $parameters['site'] contains now a site object.

PS: Many thanks for the extension and the maintenance of it.

Statistics - selected time period throws exeption

Hello,

I`m using the statistics module of mindshape_cookie_consent. When I change the time period in die select-field above, an exception is thrown saying:

Call to undefined method TYPO3\CMS\Backend\Template\ModuleTemplate::assign()

in mindshape_cookie_consent/Classes/Controller/Backend/StatisticController.php

Also the pagination doesn´t work. When clicking forward through the pages, it jumpes back to the initial selection.

Tested on Typo3 11.5.28 with PHP 8.1 and mindshape_cookie_consent 3.0.1

Thanks in advance.
Stefanie

Check multiple same cookies in the details view

Hello

Matomo uses two cookies (_pk_id.WebsiteID.DomainHash, _pk_ses.WebsiteID.DomainHash) but in the detailed view I can check the cookies individually.

I would like that if check a Matomo cookie, it will automatically both cookies.

I tried the same identifier but it only hacked the first one.

mindshape_cookie_consent_matomo

Plugin prevents Caching

Hello everyone,
we use TYPO3 v11.5.30 and mindshape_cookie_consent v3.0.1
installed with composer following the documentation:
https://docs.typo3.org/p/mindshape/mindshape-cookie-consent/main/en-us/Index.html

If we activate
plugin.tx_mindshapecookieconsent.settings.addMarkupToFooter = 1
the caching for that page is disabled.

Problem seems to be the config in ext_localconf.php

ExtensionUtility::configurePlugin(
    SettingsUtility::EXTENSION_KEY,
    'Consentmodal',
    [ConsentController::class => 'modal'],
    [ConsentController::class => 'modal'],
ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT
);

If I remove the action from $nonCacheableControllerActions like this:

ExtensionUtility::configurePlugin(
    SettingsUtility::EXTENSION_KEY,
    'Consentmodal',
    [ConsentController::class => 'modal'],
    [],
    ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT
);

then the page is cached correctly.

The same problem seems to occur if we put a ContentElement of CType mindshapecookieconsent_consent on a page.

In v2.2.5 the caching worked...

Is this a known bug or a configuration mistake?

Load something (Google Tag Manager) on every page view, as long as the option was confirmed before

In this example, "console.log('load analytics')" is only executed after I have initially confirmed the cookie window.
But I want to load something on every page load, as long as the option was confirmed before. How is this possible?

window.addEventListener('cookieConsent', function (event) {
    if (event.detail.hasOption('google_analytics')) {

        if (false === window.analyticsLoaded) {
            // load analytics
            console.log('load analytics')
            window.analyticsLoaded = true;
        }
    } else {
        // do not load analytics
    }
});

Error on Statistics View

I get the following message while clicking on statistics view:

Oops, an error occurred!
No site found for identifier §§§ALL_SITES§§§
More information regarding this error might be available online.

Please help.

TYPO3 11

Is it intended to support TYPO3 11?

Error: Return value of Mindshape\MindshapeCookieConsent\Utility\CookieUtility::getCookieValue() must be of the type array or null, bool returned

Hi,

my TYPO3 log gets floodes with messages like:

Core: Exception handler (WEB): Uncaught TYPO3 Exception: Return value of Mindshape\MindshapeCookieConsent\Utility\CookieUtility::getCookieValue() must be of the type array or null, bool returned | TypeError thrown in file /xyz/typo3conf/ext/mindshape_cookie_consent/Classes/Utility/CookieUtility.php in line 34. Requested URL: https://www.tld.com/path/

Currently I don’t know how to reproduce the issue myself.

TYPO3 10, mindshape_cookie_consent 2.2.5

TYPO3 12 CSP settings

The inline script <script data-ignore="1"> is being blocked by the Content Security Policy in TYPO3 12.4.9. Unsafe inline can't be used when the nonce option is used.

Problem with current PHP 8.3.2 version

Hi Daniel,

I use the mindshape_cookie_consent extension with TYPO3 v12.4.11 and PHP 8.3.2 and I get the following error message, when I try to execute composer update:
- mindshape/mindshape-cookie-consent v3.1.2 requires php >=8.0 <=8.3 -> your php version (8.3.2) does not satisfy that requirement.

When I set the PHP version to 8.3.0 it works. Did you indicate problems with PHP 8.3.2 or is it just an adjustment in the composer.json file?

Cheers
Christopher

Only display consent if activated

The consent is already shown if the extension is installed. It would be great if the admin has to activate or include the typoscript first.

Preselection

One customer wishs, that the Cookies are preselected. I can't find an entry for this. Is this feature not implemented?

image

Missing neccessary cookies in "Cookie List"

The "Cookie List"-Plugin does not list the neccessary cookies. It only shows the custom categories and their cookies. I think the neccessary cookies should also be be listed.

Best regards, Gianni

Can't overwritte language labels with typoscript

I tried it with the key which seems corectly for me.

plugin.tx_mindshapecookieconsent_consent {
_LOCAL_LANG.de {
label {
imprint = Database
necessary_cookies = Database
}
}
}

I try also this

plugin.tx_mindshapecookieconsent {
_LOCAL_LANG.de {
label {
imprint = Database
necessary_cookies = Database
}
}
}

But nothings works for me.
How to write it correctly.

Greetings
Martin

necessaryCookieOption.identifier is empty

For the checkboxes the id will be generated by {idPrefix}-cookieoption-{necessaryCookieOption.identifier}. But {necessaryCookieOption.identifier} is empty, which will lead to duplicated id values, if you have more than 1 necessary cookie.

Maybe it's better to use {idPrefix}-cookieoption-{necessaryCookieOption.uid} instead. And to unify it, {idPrefix}-cookieoption-{cookieOption.uid} could be used for the optional cookie checkboxes.

Add script bug

It seems that there is a bug with the integration of scripts.

If you are on a page where the m:consent ViewHelper is included and this should load a script, then this is always loaded as soon as any cookie option is allowed.

For example, on a page GoogleMaps should be loaded by m:consent ViewHelper. If you are on this page and any other cookie is allowed (e.g. "matomo"), the Google script is always loaded as well (see Network-Traffic). Even if you have not allowed this via the Consent buttons.

The error seems to be in the cookie_consent.js in the function replaceConsentButtons. There the data-scripts attributes are collected but at this point no longer checked for the cookieOption.

Best Regards, Gianni

Installation breaks Typo3 Backend & Frontend

During installation of the extension, the typo3 (v10.4.21) installation breaks. Both frontend and backend are not accessible anymore and yield a 500 Internal Server Error.
In my logs I find the following:

"PHP Fatal error: Uncaught LogicException: TYPO3\CMS\Core\Cache\CacheManager can not be injected/instantiated during ext_localconf.php loading. Use lazy loading instead. in /data/www/XXX.at/typo3_src-10.4.21/typo3/sysext/core/Classes/ServiceProvider.php:97
Stack trace:
#25 /data/www/XXX.at/httpdocs/typo3temp/var/cache/code/di/DependencyInjectionContainer_93869b03c4340f3e471a4b1ff32c6a92846b15aa.php(5197): TYPO3\CMS\Core\ServiceProvider::getCacheManager()
#1 /data/www/XXX.at/typo3_src-10.4.21/vendor/symfony/dependency-injection/Container.php(248): DependencyInjectionContainer_93869b03c4340f3e471a4b1ff32c6a92846b15aa->getCacheManagerService()
#2 /data/www/XXX.at/typo3_src-10.4.21/vendor/symfony/dependency-injection/Container.php(228): Symfony\Component\DependencyInjection\Container->make()
#3 /data/www/XXX.at/typo3_src-10.4.21/typo3/sysext/core/Classes/ServiceProvider.php(210): Symfony\Component\DependencyInjection\Container->get()
#4 /data/www/XXX.at/httpdoc in /data/www/XXX.at/typo3_src-10.4.21/typo3/sysext/core/Classes/ServiceProvider.php on line 97

I have not found anything on this matter so far so I assume it is related to my typo3 setup and the installed extensions more than a bug in your extension. However, the cache related error made sense to me as it is used in hooks in the ext_localconf.php which is somewhat stated in the error message, so I thought I would raise this here. Any idea on why this is happening for me?

Add v11 compatibility

Hi,
are there already plan to make mindshape-cookie-consent compatible with TYPO3 v11?

Disable load googleAnalytics and piwik from cs_seo plugin

Hello

i have a feature request

i use the cs_seo plugin for seo analyse and to add Google Analytics and Piwik.

If I am informed correctly then I could load the code manually (event.detail.hasOption('google_analytics')) with your Cookie Consent or not but what about the integration through the plugin cs_seo.

Will there be a possibility not to load Google Analytics and Piwik there?

Here see how cs_seo add analytics code
https://github.com/clickstorm/cs_seo/blob/master/Configuration/TypoScript/Setup/Tracking/googleAnalytics.typoscript
https://github.com/clickstorm/cs_seo/blob/master/Configuration/TypoScript/Setup/Tracking/piwik.typoscript

only one button when all cookies are necessary

Hi,

when there are only necessary cookies it would be nice if there was only one button like 'Okay' instead of both of the 'Select all' AND 'Save' buttons.

This would be helpful if you start with a simple set of cookies, adding further choices later on in your TYPO3.

Best regards

ch

TCA points to non-existent field label

The TCA for tx_mindshapecookieconsent_domain_model_statisticbutton, tx_mindshapecookieconsent_domain_model_statisticcategory and tx_mindshapecookieconsent_domain_model_statisticoption points to a non-existent field "label".

On one TYPO3-installation at DB-comparison this resulted in SQL-errors where TYPO3 tried to query that field. Commenting out the "label"-row from TCA made it work again.

[...]
Core: Exception handler (WEB): Uncaught TYPO3 Exception: An exception occurred while executing 'SELECT uid, pid, label FROM tx_mindshapecookieconsent_domain_model_statisticbutton WHERE ...

Cannot add override labels with new language

Unfortunately, translations of labels do not work. I cannot translate the two labels "imprint" and "Datapolicy" in the Consent-Modal.

I need Spanish labels in the plugin. Unfortunately, I can neither add Spanish labels via _LOCALLANG nor via locallangXMLOverride.

plugin.tx_mindshapecookieconsent._LOCAL_LANG.es {
  label.imprint = Aviso legal
  label.datapolicy = Política de privacidad
}

or

    $GLOBALS['TYPO3_CONF_VARS']['SYS']['locallangXMLOverride']['es']
    ['EXT:mindshape_cookie_consent/Resources/Private/Language/es.locallang.xlf'][]
        = 'EXT:agaplesion_template/Resources/Extensions/mindshape_coockieconsent/Language/es.locallang.xlf';

Greetings, Gianni

Error in Log: Core: Exception handler (WEB): Uncaught TYPO3 Exception: Mindshape\MindshapeCookieConsent\Service\CookieConsentService::__construct(): Argument #2 ($configurationRepository) must be of type Mindshape\MindshapeCookieConsent\Domain\Repository\ConfigurationRepository

Hi there,

we did an update to mindshape_cookie_consent version 3.0.1 on Monday 24th.
Since then, we do get several entries in the log, here is the full log entry:

Core: Exception handler (WEB): Uncaught TYPO3 Exception: Mindshape\MindshapeCookieConsent\Service\CookieConsentService::__construct(): Argument #2 ($configurationRepository) must be of type Mindshape\MindshapeCookieConsent\Domain\Repository\ConfigurationRepository, Mindshape\MindshapeCookieConsent\Service\TemplateRenderingService given, called in /../typo3_src-11.5.29/typo3/sysext/core/Classes/Utility/GeneralUtility.php on line 3249 | TypeError thrown in file /../typo3conf/ext/mindshape_cookie_consent/Classes/Service/CookieConsentService.php in line 96. Requested URL: xyz

We are using:
TYPO3 11.5.29
mindshape_cookie_consent 3.0.1
bootstrap_package: 13.0.2

Do you know how to fix this?

Thx in advance & best regards
Clea

Incompatibility problem with Typo3 10.4.2 since version 2.0.0

I'm using Typo3 10.4.22 and PHP 7.4. Since the version 2.0.0 the statistics in the backend dont work anymore. The following error is showing:

Too few arguments to function TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper::__construct(), 0 passed in .../typo3_src-10.4.22/typo3/sysext/core/Classes/Utility/GeneralUtility.php on line 3480 and at least 7 expected
....
at TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Mapper\\DataMapper')
in .../typo3conf/ext/mindshape_cookie_consent/Classes/Domain/Repository/AbstractStatisticRepository.php line 82

I've tested it on more than one site, and the error comes on any site, where i'm using Typo3 10.4.22.

I think there is an version conflict. Can anybody help?
Thank you!

Different Cookies per Language

Hi.
I have to set an own cookie in one language version of the website. That's why I created a cookie in this language that only exists here. I now hoped that the consent banner would be displayed again when the language was changed, even if it had already been used in the default language.

Is something like that even possible?

Thanks
Stephan

Wrong path for resources

Hi,

I just found a bug in version 1.0.6 of this extension.
In RenderPreProcessHook.php there are 2 calls to PathUtility::getAbsoluteWebPath. 1 for CSS & 1 for JS.
For most people this will work as it is, but only out of pure coincidence. The strings you pass both start with a slash. Thus PathUtility::getAbsoluteWebPath will treat them like absolute paths and return the exact string you passed to it without changing it.

As a result, there will be 404 errors for JS & CSS in the frontend, if the Typo3 root is not the document root, because it always returns "myDomain.com/typo3conf/..." even when it should be "myDomain.com/mySite/typo3conf/..."

It will work if you remove the leading slashes.

Error with frontend_editing

Hello,
we use the frontend_editing and get the following error:

(1/1) TypeError
array_key_exists() expects parameter 2 to be array, null given

in /var/www/vhosts/photos/domain.de/typo3conf/ext/mindshape_cookie_consent/Classes/Utility/SettingsUtility.php line 61
try {
$typoscript = $configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT);
$typoscript = GeneralUtility::removeDotsFromTS($typoscript);

        if (false === array_key_exists(self::EXTENSION_TYPOSCRIPT_KEY, $typoscript['plugin'])) {

TypeError in List View, TYPO3 12.4.9

After switching from TYPO3 version 12.4.8 to 12.4.9 we get a TypeError after accessing List view to the Page, where the Cookie Config ist stored:

Mindshape\MindshapeCookieConsent\UserFunc\ConfigurationTcaUserFunc::sitesItemsProcFunc(): Argument #2 ($tcaSelectItems) must be of type TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems, TYPO3\CMS\Core\DataHandling\ItemProcessingService given

in [...]/vendor/mindshape/mindshape-cookie-consent/Classes/UserFunc/ConfigurationTcaUserFunc.php line 44

Thanks & best regards
-Markus

Trying to create translation of necessary_cookie_options entries throws SQL "incorrect integer value" error

System information:
TYPO3 11.5
PHP 7.4.30
MariaDB 10.5 (MySQL 5.5.5-10.5.15-MariaDB-0+deb11u1)

If you try to create a translation for a necessary_cookie_options item, the following SQL error is thrown:
2: SQL error: 'Incorrect integer value: '' for column db.tx_mindshapecookieconsent_domain_model_cookieoption.cookie_category at row 1' (tx_mindshapecookieconsent_domain_model_cookieoption:NEW636d1917988cd937434709)

The problem should be the new defaults for MariaDB. It enforces field types more strictly, and therefore '' is not cast to integer.
Adding a default => 0 value to the TCA configuration fixed the issue.

'cookie_category' => [
'exclude' => true,
'label' => 'LLL:EXT:mindshape_cookie_consent/Resources/Private/Language/locallang.xlf:tca.cookie_category.label',
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'foreign_table' => \Mindshape\MindshapeCookieConsent\Domain\Model\CookieCategory::TABLE,
],

Path of javascript and stylesheets is incorrect when used with TYPO3 11

In RenderPreProcessHook.php the javascript and styles are included.

                if (true === (bool)$settings['addJavaScript']) {
                    $pageRenderer->addJsFooterLibrary(
                        'cookie_consent',
                        PathUtility::getAbsoluteWebPath('typo3conf/ext/mindshape_cookie_consent/Resources/Public/JavaScript/cookie_consent.js')
                    );
                }

                if (true === (bool)$settings['addStylesheet']) {
                    $pageRenderer->addCssFile(
                        PathUtility::getAbsoluteWebPath('typo3conf/ext/mindshape_cookie_consent/Resources/Public/Stylesheet/cookie_consent.css')
                    );
                }

In TYPO3 11 though the extension is installed inside of vendor/mindshape/mindshape-cookie-consent/ not typo3conf/ext/mindshape_cookie_consent/. To temporarily fix this I am using a symlink mindshape_cookie_consent -> ../../../vendor/mindshape/mindshape-cookie-consent/ inside of typo3conf/ext.

PHP Warnings.

mindshape_cookie_consent 2.2.5, Typo3 11.5.26, php 8.0 (and 8.2)

PHP Warning: Trying to access array offset on value of type null in /html/typo3/typo3conf/ext/mindshape_cookie_consent/Classes/Service/TemplateRenderingService.php line 39
PHP Warning: Undefined array key "disableConsent" in /html/typo3/typo3conf/ext/mindshape_cookie_consent/Classes/Hook/RenderPreProcessHook.php line 56
PHP Warning: Undefined array key "addConfiguration" in /html/typo3/typo3conf/ext/mindshape_cookie_consent/Classes/Hook/RenderPreProcessHook.php line 57
PHP Warning: Undefined array key "addJavaScript" in /html/typo3/typo3conf/ext/mindshape_cookie_consent/Classes/Hook/RenderPreProcessHook.php line 82
PHP Warning: Undefined array key "addStylesheet" in /html/typo3/typo3conf/ext/mindshape_cookie_consent/Classes/Hook/RenderPreProcessHook.php line 89
PHP Warning: Undefined array key "addMarkupToFooter" in /html/typo3/typo3conf/ext/mindshape_cookie_consent/Classes/Hook/RenderPreProcessHook.php line 95

Regards Bernhard

Google Consent Mode [Feature Request]

Google Consent Mode Integration (Feature Request)

Hi, it would be nice (essential for comercial use) to have a tracking without consent.
When do you support google consent mode?
Greets from Münster, M.

Required argument "consent" is not set for Mindshape\ ...

got this error:
Core: Exception handler (WEB): Uncaught TYPO3 Exception: #1298012500: Required argument "consent" is not set for Mindshape\MindshapeCookieConsent\Controller\ConsentController->consent. | TYPO3\CMS\Extbase\Mvc\Controller\Exception\RequiredArgumentMissingException thrown in file /html/typo3/typo3_src-10.4.9/typo3/sysext/extbase/Classes/Mvc/Controller/ActionController.php in line 960. ...

Typo3 10.4.9, Mindshape 1.0.4

TYPO3 Exception: syntax error, unexpected ')'

Hi there,
after updating from version 2.2.5 to 3.0.1 i got this message in my backend log (protokoll):

Core: Exception handler (CLI): Uncaught TYPO3 Exception: syntax error, unexpected ')', expecting '|' or variable (T_VARIABLE) | ParseError thrown in file /mnt/......typo3conf/ext/mindshape_cookie_consent/Classes/Utility/SettingsUtility.php in line 42

TYPO3 Vers. 11.5.28
PHP: 8.1.19
Bootstrap Package: 13.0.2

I did not do any changes in my previous configuration (so far i know), so i wonder about that message. Got someone any idea what is wrong and how to fix it?

THX a lot and have a nice day

How to disable the plugin for frontend_editing?

The plugin is really annoying when using the frontend_editing plugin, the popup is always reloaded.
Can't the plugin be switched off completely as soon as a backend user is logged in? Unfortunately that does not work:

[backend.user.isLoggedIn]
plugin.tx_mindshapecookieconsent >

[end]

fire if event cookieConsent on load

Hi,
I thought that the event cookieConsent also fires on load, so that you can check the status of previously set cookies.
How else can I check via JavaScript which cookies have been set?

Consecutive page calls

Hello,

so the EventListener gets fired when the user agrees to the options form. But how about finding out which options have been consented to in consecutive page calls? Do I need to read the cookie options myself or is there a Javascript object?

PHP 8.2 compatibility

The latest version can't be installed via composer for PHP 8.2.x (x>0).
Is there a reason why the extension is set to only be compatible with PHP up to and including 8.2.0?
Is it just a typo, "php": "~8.0 <=8.2" instead of "php": "~8.0 <8.3"?

Localisation not working

Bildschirmfoto vom 2021-08-26 12-46-36
Line 54 in the methode findByUidIgnoreLanguage in the ConfigurationRepository prevents correct localisation in my project. All textlines that come from configuration (header, hint, buttons, show / hide details) are in the default language. Every other text is in the correct localised language. When I comment out this one line it works fine.
Does this line have a purpose I don't understand?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.