Skip to content

Commit

Permalink
Merge pull request #104 from RedTurtle/gdprcookie
Browse files Browse the repository at this point in the history
collective.volto.cookieconsent => collective.volto.gdprcookie
  • Loading branch information
cekk authored Apr 10, 2024
2 parents d55121a + 25e1774 commit 823c996
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 7 deletions.
5 changes: 4 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ Changelog
[cekk]
- Exclude bg_color from transformed fields in deserializer.
[cekk]

- Uninstall collective.volto.cookieconsent (deprecated). Will be removed from dependencies in next releases.
[cekk]
- Add dependency to collective.volto.gdprcookie and install it by default.
[cekk]

5.4.8 (2024-03-19)
------------------
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@
python_requires=">=3.7",
install_requires=[
"setuptools",
"collective.volto.cookieconsent",
"collective.volto.cookieconsent", # this will be uninstalled and removed soon.
"collective.volto.gdprcookie",
"collective.monkeypatcher",
"collective.purgebyid",
"kitconcept.seo>=2.0.0",
Expand Down
4 changes: 2 additions & 2 deletions src/redturtle/volto/profiles/default/metadata.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<version>4304</version>
<version>4305</version>
<dependencies>
<dependency>profile-plone.volto:default</dependency>
<dependency>profile-plone.app.caching:with-caching-proxy</dependency>
<dependency>profile-collective.volto.cookieconsent:default</dependency>
<dependency>profile-collective.volto.gdprcookie:default</dependency>
<dependency>profile-kitconcept.seo:default</dependency>
</dependencies>
</metadata>
6 changes: 3 additions & 3 deletions src/redturtle/volto/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from plone.restapi.testing import PloneRestApiDXLayer
from plone.testing import z2

import collective.volto.cookieconsent
import collective.volto.gdprcookie
import kitconcept.seo
import plone.app.caching
import plone.restapi
Expand All @@ -23,7 +23,7 @@ def setUpZope(self, app, configurationContext):
# Load any other ZCML that is required for your tests.
# The z3c.autoinclude feature is disabled in the Plone fixture base
# layer.
self.loadZCML(package=collective.volto.cookieconsent)
self.loadZCML(package=collective.volto.gdprcookie)
self.loadZCML(package=plone.restapi)
self.loadZCML(package=redturtle.volto)
self.loadZCML(package=plone.volto)
Expand Down Expand Up @@ -66,7 +66,7 @@ class RedturtleVoltoRestApiLayer(PloneRestApiDXLayer):
def setUpZope(self, app, configurationContext):
super(RedturtleVoltoRestApiLayer, self).setUpZope(app, configurationContext)

self.loadZCML(package=collective.volto.cookieconsent)
self.loadZCML(package=collective.volto.gdprcookie)
self.loadZCML(package=plone.restapi)
self.loadZCML(package=plone.volto)
self.loadZCML(package=redturtle.volto)
Expand Down
14 changes: 14 additions & 0 deletions src/redturtle/volto/upgrades.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
from uuid import uuid4
from zope.schema import getFields


try:
from plone.base.utils import get_installer
except Exception:
from Products.CMFPlone.utils import get_installer

import json
import logging

Expand Down Expand Up @@ -494,3 +500,11 @@ def to_4303(context):
for brain in brains:
event = brain.getObject()
event.reindexObject(idxs=["start", "end"])


def to_4305(context):
portal = api.portal.get()
installer = get_installer(portal, portal.REQUEST)
installer.uninstall_product(product_id="collective.volto.cookieconsent")
if not installer.is_product_installed("collective.volto.gdprcookie"):
installer.install_(product_id="collective.volto.gdprcookie")
8 changes: 8 additions & 0 deletions src/redturtle/volto/upgrades.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -224,4 +224,12 @@
destination="4304"
handler=".upgrades.update_registry"
/>
<genericsetup:upgradeStep
title="Remove old cookie plugin and install new one"
description=""
profile="redturtle.volto:default"
source="4304"
destination="4305"
handler=".upgrades.to_4305"
/>
</configure>

0 comments on commit 823c996

Please sign in to comment.