TheBnl / silverstripe-cookie-consent

GDPR compliant cookie popup and consent checker
BSD 3-Clause "New" or "Revised" License
16 stars 7 forks source link

Module causes a failing dev/build #30

Open J-Pielage opened 3 years ago

J-Pielage commented 3 years ago

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');

TheBnl commented 3 years ago

Thanks for bringing this up, so far I haven't noticed the error myself. While doing the update did the cookie-concent package update as well? It could possibly be that the classnames have changed between versions to make it compatible with the PSR-4 standard.

for example: Broarm\CookieConsent\CookieGroup was changed to: Broarm\CookieConsent\Model\CookieGroup

So maybe it is an issue with your cookie configuration?

J-Pielage commented 3 years ago

@TheBnl Sorry for my very late response, yes I did upgrade the cookie-consent package. I first had dev-master installed on 4.5.1. and then re-installed so it picked the latest released version.

On new projects the package does work though, so perhaps the switch between dev-master and latest release causes some issues.