thebnl / silverstripe-cookie-consent Goto Github PK
View Code? Open in Web Editor NEWGDPR compliant cookie popup and consent checker
License: BSD 3-Clause "New" or "Revised" License
GDPR compliant cookie popup and consent checker
License: BSD 3-Clause "New" or "Revised" License
Tried to override the page layout and found that I had to put the override into
templates/Broarm/CookieConsent/CookiePolicyPage.ss templates/Broarm/CookieConsent/CookieConsentCheckboxField_holder.ss
Instead of templates/Layout and templates/Includes
Hi,
I recently tried to update a 4.5.1 project to a newer version (4.7.3@stable) but the module caused a building failure.
I noticed a warming about an array to string conversion inside the CookieGroup file on lines 147 - 149:
$cookie = CookieDescription::create(array( 'ConfigName' => $cookieName, 'Title' => $cookieName, **'Provider' => $providerLabel, 'Purpose' => _t("CookieConsent_{$providerName}.{$cookieName}_Purpose", "$cookieName"), 'Expiry' => _t("CookieConsent_{$providerName}.{$cookieName}_Expiry", 'Session')** 150 ));
The same message also occurs on this line:
DB::alteration_message(sprintf('Cookie "%s" created and added to group "%s"', $cookieName, $groupName), 'created');
Hi,
I just got the following error in bramdeleeuw/cookieconsent/src/CookieConsent.php
when running on PHP 8.1:
[Deprecated] explode(): Passing null to parameter #2 ($string) of type string is deprecated
GET /server-error/
Line 123 in /usr/src/myapp/vendor/bramdeleeuw/cookieconsent/src/CookieConsent.php
It seems Cookie::get(CookieConsent::COOKIE_NAME)
return null which is no longer allowed.
Go to settings > cookie consent > cookies > necessary
and click to edit triggers the following. Possible related to https://github.com/tractorcow/silverstripe-fluent/issues/318 and that the silverstripe-australia/gridfieldextensions
is abandoned in favour of symbiote/silverstripe-gridfieldextensions
[Emergency] Uncaught Exception: Inline adding requires the editable columns component
GET /admin/settings/EditForm/field/Cookies/item/1/edit
Line 90 in /var/www/html/gridfieldextensions/src/GridFieldAddNewInlineButton.php
Source
81 public function getHTMLFragments($grid)
82 {
83 if ($grid->getList() && !singleton($grid->getModelClass())->canCreate()) {
84 return array();
85 }
86
87 $fragment = $this->getFragment();
88
89 if (!$editable = $grid->getConfig()->getComponentByType('GridFieldEditableColumns')) {
90 throw new Exception('Inline adding requires the editable columns component');
91 }
92
93 Requirements::javascript(THIRDPARTY_DIR . '/javascript-templates/tmpl.js');
94 GridFieldExtensions::include_requirements();
95
96 $data = new ArrayData(array(
Trace
Symbiote\GridFieldExtensions\GridFieldAddNewInlineButton->getHTMLFragments(SilverStripe\Forms\GridField\GridField)
GridField.php:341
SilverStripe\Forms\GridField\GridField->FieldHolder()
call_user_func_array(Array, Array)
ViewableData.php:481
SilverStripe\View\ViewableData->obj(FieldHolder, , 1)
ViewableData.php:543
SilverStripe\View\ViewableData->XML_val(FieldHolder, , 1)
SSViewer_Scope.php:323
SilverStripe\View\SSViewer_Scope->__call(XML_val, Array)
SSViewer_DataPresenter.php:309
SilverStripe\View\SSViewer_DataPresenter->__call(XML_val, Array)
.cachevendor.silverstripe.admin.themes.cms-forms.templates.SilverStripe.Forms.CMSTabSet.ss:52
include(/var/www/html/silverstripe-cache/www-data/.cachevendor.silverstripe.admin.themes.cms-forms.templates.SilverStripe.Forms.CMSTabSet.ss)
SSViewer.php:602
SilverStripe\View\SSViewer->includeGeneratedTemplate(/var/www/html/silverstripe-cache/www-data/.cachevendor.silverstripe.admin.themes.cms-forms.templates.SilverStripe.Forms.CMSTabSet.ss, SilverStripe\Forms\TabSet, , Array, )
SSViewer.php:674
SilverStripe\View\SSViewer->process(SilverStripe\Forms\TabSet, )
ViewableData.php:397
SilverStripe\View\ViewableData->renderWith(SilverStripe\View\SSViewer)
TabSet.php:137
SilverStripe\Forms\TabSet->FieldHolder()
call_user_func_array(Array, Array)
ViewableData.php:481
SilverStripe\View\ViewableData->obj(FieldHolder, , 1)
ViewableData.php:543
SilverStripe\View\ViewableData->XML_val(FieldHolder, , 1)
SSViewer_Scope.php:323
SilverStripe\View\SSViewer_Scope->__call(XML_val, Array)
SSViewer_DataPresenter.php:309
SilverStripe\View\SSViewer_DataPresenter->__call(XML_val, Array)
.cachevendor.silverstripe.admin.templates.SilverStripe.Admin.Includes.LeftAndMain_EditForm.ss:161
include(/var/www/html/silverstripe-cache/www-data/.cachevendor.silverstripe.admin.templates.SilverStripe.Admin.Includes.LeftAndMain_EditForm.ss)
SSViewer.php:602
SilverStripe\View\SSViewer->includeGeneratedTemplate(/var/www/html/silverstripe-cache/www-data/.cachevendor.silverstripe.admin.templates.SilverStripe.Admin.Includes.LeftAndMain_EditForm.ss, SilverStripe\Forms\Form, , Array, )
SSViewer.php:674
SilverStripe\View\SSViewer->process(SilverStripe\Forms\Form, )
ViewableData.php:397
SilverStripe\View\ViewableData->renderWith(SilverStripe\View\SSViewer)
Form.php:1567
SilverStripe\Forms\Form->forTemplate()
ViewableData.php:545
SilverStripe\View\ViewableData->XML_val(ItemEditForm, , 1)
SSViewer_Scope.php:323
SilverStripe\View\SSViewer_Scope->__call(XML_val, Array)
SSViewer_DataPresenter.php:309
SilverStripe\View\SSViewer_DataPresenter->__call(XML_val, Array)
.cachevendor.silverstripe.framework.templates.SilverStripe.Forms.GridField.GridFieldDetailForm_ItemRequest.ss:2
include(/var/www/html/silverstripe-cache/www-data/.cachevendor.silverstripe.framework.templates.SilverStripe.Forms.GridField.GridFieldDetailForm_ItemRequest.ss)
SSViewer.php:602
SilverStripe\View\SSViewer->includeGeneratedTemplate(/var/www/html/silverstripe-cache/www-data/.cachevendor.silverstripe.framework.templates.SilverStripe.Forms.GridField.GridFieldDetailForm_ItemRequest.ss, SilverStripe\View\ViewableData_Customised, , Array, )
SSViewer.php:674
SilverStripe\View\SSViewer->process(SilverStripe\View\ViewableData_Customised, )
ViewableData.php:397
SilverStripe\View\ViewableData->renderWith(SilverStripe\View\SSViewer)
GridFieldDetailForm_ItemRequest.php:142
SilverStripe\Forms\GridField\GridFieldDetailForm_ItemRequest->edit(SilverStripe\Control\HTTPRequest)
RequestHandler.php:319
SilverStripe\Control\RequestHandler->handleAction(SilverStripe\Control\HTTPRequest, edit)
RequestHandler.php:201
SilverStripe\Control\RequestHandler->handleRequest(SilverStripe\Control\HTTPRequest)
GridFieldDetailForm.php:118
SilverStripe\Forms\GridField\GridFieldDetailForm->handleItem(SilverStripe\Forms\GridField\GridField, SilverStripe\Control\HTTPRequest)
GridField.php:1031
SilverStripe\Forms\GridField\GridField->handleRequest(SilverStripe\Control\HTTPRequest)
RequestHandler.php:225
SilverStripe\Control\RequestHandler->handleRequest(SilverStripe\Control\HTTPRequest)
RequestHandler.php:225
SilverStripe\Control\RequestHandler->handleRequest(SilverStripe\Control\HTTPRequest)
Controller.php:212
SilverStripe\Control\Controller->handleRequest(SilverStripe\Control\HTTPRequest)
LeftAndMain.php:752
SilverStripe\Admin\LeftAndMain->handleRequest(SilverStripe\Control\HTTPRequest)
AdminRootController.php:123
SilverStripe\Admin\AdminRootController->handleRequest(SilverStripe\Control\HTTPRequest)
Director.php:361
SilverStripe\Control\Director->SilverStripe\Control\{closure}(SilverStripe\Control\HTTPRequest)
VersionedHTTPMiddleware.php:40
SilverStripe\Versioned\VersionedHTTPMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
BasicAuthMiddleware.php:68
SilverStripe\Security\BasicAuthMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
AuthenticationMiddleware.php:61
SilverStripe\Security\AuthenticationMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
CanonicalURLMiddleware.php:155
SilverStripe\Control\Middleware\CanonicalURLMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
FlushMiddleware.php:26
SilverStripe\Control\Middleware\FlushMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
RequestProcessor.php:66
SilverStripe\Control\RequestProcessor->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
SessionMiddleware.php:20
SilverStripe\Control\Middleware\SessionMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
AllowedHostsMiddleware.php:60
SilverStripe\Control\Middleware\AllowedHostsMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
TrustedProxyMiddleware.php:176
SilverStripe\Control\Middleware\TrustedProxyMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
HTTPMiddlewareAware.php:65
SilverStripe\Control\Director->callMiddleware(SilverStripe\Control\HTTPRequest, Closure)
Director.php:370
SilverStripe\Control\Director->handleRequest(SilverStripe\Control\HTTPRequest)
HTTPApplication.php:48
SilverStripe\Control\HTTPApplication->SilverStripe\Control\{closure}(SilverStripe\Control\HTTPRequest)
call_user_func(Closure, SilverStripe\Control\HTTPRequest)
HTTPApplication.php:66
SilverStripe\Control\HTTPApplication->SilverStripe\Control\{closure}(SilverStripe\Control\HTTPRequest)
call_user_func(Closure, SilverStripe\Control\HTTPRequest)
ErrorControlChainMiddleware.php:56
SilverStripe\Core\Startup\ErrorControlChainMiddleware->SilverStripe\Core\Startup\{closure}(SilverStripe\Core\Startup\ErrorControlChain)
call_user_func(Closure, SilverStripe\Core\Startup\ErrorControlChain)
ErrorControlChain.php:236
SilverStripe\Core\Startup\ErrorControlChain->step()
ErrorControlChain.php:226
SilverStripe\Core\Startup\ErrorControlChain->execute()
ErrorControlChainMiddleware.php:69
SilverStripe\Core\Startup\ErrorControlChainMiddleware->process(SilverStripe\Control\HTTPRequest, Closure)
HTTPMiddlewareAware.php:62
SilverStripe\Control\HTTPApplication->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest)
HTTPMiddlewareAware.php:65
SilverStripe\Control\HTTPApplication->callMiddleware(SilverStripe\Control\HTTPRequest, Closure)
HTTPApplication.php:67
SilverStripe\Control\HTTPApplication->execute(SilverStripe\Control\HTTPRequest, Closure, )
HTTPApplication.php:49
SilverStripe\Control\HTTPApplication->handle(SilverStripe\Control\HTTPRequest)
index.php:26
Hi. Trying to install this into my project, fairly new to SS4, but everything installed via composer so far has gone into my vendor
directory. However when I install this it goes into the root directory. Is this correct behaviour or have I missed something?
Hi
We use the module in several projects - when using more than 3 cookie categories (f.e. necessary, analytics, social media, video) the "saving" action at the cookie settings page (CookiePolicyPage
) is behaving strange.
After choosing 3 of 4 categories and submitting, some categories stay active, others get unchecked again and do not get saved.
I just did a fresh install with SS4.8, it´s the same.
Any ideas? Thanks!
Trying to disable css and javascript through a app/_config/cookies.yml
file with the following content:
---
Name: cookies
---
Broarm\CookieConsent\CookieConsent:
include_javascript: false
include_css: false
create_default_pages: false
cookies:
Necessary:
local:
- PHPSESSID
- CookieConsent
Analytics:
local:
- _ga
- _gid
However, both this config and the one that comes with the package seem to get merged together, with the package config taking priority. This gives me the following:
Array
(
[cookies] => Array
(
[Necessary] => Array
(
[local] => Array
(
[0] => PHPSESSID
[1] => CookieConsent
[2] => PHPSESSID
[3] => CookieConsent
)
)
[Analytics] => Array
(
[local] => Array
(
[0] => _ga
[1] => _gid
)
)
)
[include_javascript] => 1
[include_css] => 1
[create_default_pages] => 1
[extensions] => Array
(
)
[unextendable_classes] => Array
(
[0] => SilverStripe\View\ViewableData
[1] => SilverStripe\Control\RequestHandler
)
)
As you can see the include_javascript
, include_css
and create_default_pages
are being ignored. I also had to change the XD\CookieConsent\CookieConsent:
in the documentation to Broarm\CookieConsent\CookieConsent:
.
Hi,
For a specific use case I am required to configure the domain & path for the cookie::set()
function. I couldn't find any option to configure this using the yml and in the sourcecode I only found that null
is being passed to these parameters.
On the page /cookie-policy if one adds a short code for cookie group that does not exist, such as
<p>[cookiegrouptable group="Wibble"]</p>
it is rendered to public output as
[cookiegrouptable group=""]
Hello,
really nice module, good job!
What do you think about making isRequired CookieGroup configurable in CMS. I need 2 separate groups, but both necessary...
I tried this plugin with Elemental, it seems to not work perfectly. The scripts and styles get loaded, and the overlay appears, but then it stops.
Also, I am using UserForms to provide a GDPR request form for cancellation and query for information on the privacy page. This means the privacy page will need to be a UserformPage.
The plugin seems to be very well done otherwise, my compliments. Will try it again in a minimum use case to try to figure out what went wrong.
However, what I didn't like very much is that the javascript uses vue-foundation, would have liked better for it to use jQuery.
Tried on SS3.6.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.