Skip to content

Commit

Permalink
[fc] Repository: plone.app.content
Browse files Browse the repository at this point in the history
Branch: refs/heads/master
Date: 2018-10-03T11:50:17+02:00
Author: Thomas Lotze (tlotze) <thomas@thomas-lotze.net>
Commit: plone/plone.app.content@4334efd

re #1801: add redirect_to_referrer to replace skin script

No longer pass message to the method since the message parameter wasn't used
by the original script anyway.

Files changed:
M CHANGES.rst
M plone/app/content/browser/content_status_history.py
M plone/app/content/browser/templates/content_status_history.pt
Repository: plone.app.content

Branch: refs/heads/master
Date: 2018-10-04T14:43:23+02:00
Author: Manuel Reinhardt (reinhardt) <reinhardt@syslab.com>
Commit: plone/plone.app.content@a50bfc8

Merge pull request #164 from plone/1801-remove-redirectToReferrer

re #1801: add redirect_to_referrer to replace skin script

Files changed:
M CHANGES.rst
M plone/app/content/browser/content_status_history.py
M plone/app/content/browser/templates/content_status_history.pt
  • Loading branch information
reinhardt committed Oct 4, 2018
1 parent 1e4d7e3 commit a714665
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions last_commit.txt
Original file line number Diff line number Diff line change
@@ -1,36 +1,39 @@
Repository: Products.CMFDiffTool
Repository: plone.app.content


Branch: refs/heads/master
Date: 2018-10-04T11:46:25+02:00
Author: Peter Mathis (petschki) <peter.mathis@kombinat.at>
Commit: https://github.com/plone/Products.CMFDiffTool/commit/065fab2e7db7a104fbdc246799a05085fbb17f52
Date: 2018-10-03T11:50:17+02:00
Author: Thomas Lotze (tlotze) <thomas@thomas-lotze.net>
Commit: https://github.com/plone/plone.app.content/commit/4334efda129c652a45021a5fbf6744da9a414e70

fix AT testlayer
re #1801: add redirect_to_referrer to replace skin script

No longer pass message to the method since the message parameter wasn't used
by the original script anyway.

Files changed:
M CHANGES.rst
M Products/CMFDiffTool/testing.py
M Products/CMFDiffTool/tests/BaseTestCase.py
M plone/app/content/browser/content_status_history.py
M plone/app/content/browser/templates/content_status_history.pt

b'diff --git a/CHANGES.rst b/CHANGES.rst\nindex 7bcc6bc..d293246 100644\n--- a/CHANGES.rst\n+++ b/CHANGES.rst\n@@ -10,6 +10,8 @@ Bug fixes:\n [sgeulette]\n - Flake8 corrections\n [sgeulette]\n+- fix AT tests\n+ [petschki]\n \n 3.2.1 (2018-09-23)\n ------------------\ndiff --git a/Products/CMFDiffTool/testing.py b/Products/CMFDiffTool/testing.py\nindex b183c9f..36cf2ab 100644\n--- a/Products/CMFDiffTool/testing.py\n+++ b/Products/CMFDiffTool/testing.py\n@@ -100,7 +100,11 @@ def setUpPloneSite(self, portal):\n PACKAGE_DX_FIXTURE = DXLayer()\n \n if six.PY2:\n- from plone.app.testing.bbb import PTC_FIXTURE\n+ try:\n+ from plone.app.testing.bbb_at import PTC_FIXTURE\n+ except ImportError:\n+ # plone.app.testing 5 or earlier\n+ from plone.app.testing.bbb import PTC_FIXTURE\n \n class ATLayer(PloneSandboxLayer):\n \ndiff --git a/Products/CMFDiffTool/tests/BaseTestCase.py b/Products/CMFDiffTool/tests/BaseTestCase.py\nindex 4ee11dc..cbc0a62 100644\n--- a/Products/CMFDiffTool/tests/BaseTestCase.py\n+++ b/Products/CMFDiffTool/tests/BaseTestCase.py\n@@ -18,7 +18,11 @@ def setUp(self):\n \n \n if six.PY2:\n- from plone.app.testing.bbb import PloneTestCase\n+ try:\n+ from plone.app.testing.bbb_at import PloneTestCase\n+ except ImportError:\n+ # plone.app.testing 5 or earlier\n+ from plone.app.testing.bbb import PloneTestCase\n from Products.CMFDiffTool.testing import CMFDiffToolATLayer\n \n class BaseATTestCase(PloneTestCase):\n'
b'diff --git a/CHANGES.rst b/CHANGES.rst\nindex 8384646..c8ad3ab 100644\n--- a/CHANGES.rst\n+++ b/CHANGES.rst\n@@ -20,6 +20,8 @@ Bug fixes:\n - *add item here*\n - Added get_objects_from_path_list to replace skin script. #1801\n [reinhardt]\n+- Added redirect_to_referrer to replace skin script. #1801\n+ [tlotze]\n \n \n 3.5.4 (2018-09-23)\ndiff --git a/plone/app/content/browser/content_status_history.py b/plone/app/content/browser/content_status_history.py\nindex efa382d..14eacd2 100644\n--- a/plone/app/content/browser/content_status_history.py\n+++ b/plone/app/content/browser/content_status_history.py\n@@ -128,3 +128,8 @@ def get_objects_from_path_list(self, paths=[]):\n if obj is not None:\n contents.append(obj)\n return contents\n+\n+ def redirect_to_referrer(self):\n+ referer = self.request.get(\'HTTP_REFERER\', \'\')\n+ target_url = referer.split(\'?\', 1)[0]\n+ return self.request.RESPONSE.redirect(target_url)\ndiff --git a/plone/app/content/browser/templates/content_status_history.pt b/plone/app/content/browser/templates/content_status_history.pt\nindex eb2cffc..8089871 100644\n--- a/plone/app/content/browser/templates/content_status_history.pt\n+++ b/plone/app/content/browser/templates/content_status_history.pt\n@@ -45,7 +45,7 @@\n dummy python:request.set(\'orig_template\', came_from);\n ">\n <metal:block tal:condition="python: paths and not batch"\n- tal:replace="python:context.redirectToReferrer(\'The item(s) you selected are no longer available.\')"/>\n+ tal:replace="view/redirect_to_referrer"/>\n \n <h1 class="documentFirstHeading"\n i18n:translate="heading_publishing_process">Publishing process</h1>\n'

Repository: Products.CMFDiffTool
Repository: plone.app.content


Branch: refs/heads/master
Date: 2018-10-04T14:23:40+02:00
Author: Peter Mathis (petschki) <petschki@users.noreply.github.com>
Commit: https://github.com/plone/Products.CMFDiffTool/commit/6ce0dd4a826a4bcee103ba9d078dbeb7343fed57
Date: 2018-10-04T14:43:23+02:00
Author: Manuel Reinhardt (reinhardt) <reinhardt@syslab.com>
Commit: https://github.com/plone/plone.app.content/commit/a50bfc8597018c1acdb02f79274c6951bd0b5c48

Merge pull request #35 from plone/attestlayer
Merge pull request #164 from plone/1801-remove-redirectToReferrer

fix AT testlayer
re #1801: add redirect_to_referrer to replace skin script

Files changed:
M CHANGES.rst
M Products/CMFDiffTool/testing.py
M Products/CMFDiffTool/tests/BaseTestCase.py
M plone/app/content/browser/content_status_history.py
M plone/app/content/browser/templates/content_status_history.pt

b'diff --git a/CHANGES.rst b/CHANGES.rst\nindex 7bcc6bc..d293246 100644\n--- a/CHANGES.rst\n+++ b/CHANGES.rst\n@@ -10,6 +10,8 @@ Bug fixes:\n [sgeulette]\n - Flake8 corrections\n [sgeulette]\n+- fix AT tests\n+ [petschki]\n \n 3.2.1 (2018-09-23)\n ------------------\ndiff --git a/Products/CMFDiffTool/testing.py b/Products/CMFDiffTool/testing.py\nindex b183c9f..36cf2ab 100644\n--- a/Products/CMFDiffTool/testing.py\n+++ b/Products/CMFDiffTool/testing.py\n@@ -100,7 +100,11 @@ def setUpPloneSite(self, portal):\n PACKAGE_DX_FIXTURE = DXLayer()\n \n if six.PY2:\n- from plone.app.testing.bbb import PTC_FIXTURE\n+ try:\n+ from plone.app.testing.bbb_at import PTC_FIXTURE\n+ except ImportError:\n+ # plone.app.testing 5 or earlier\n+ from plone.app.testing.bbb import PTC_FIXTURE\n \n class ATLayer(PloneSandboxLayer):\n \ndiff --git a/Products/CMFDiffTool/tests/BaseTestCase.py b/Products/CMFDiffTool/tests/BaseTestCase.py\nindex 4ee11dc..cbc0a62 100644\n--- a/Products/CMFDiffTool/tests/BaseTestCase.py\n+++ b/Products/CMFDiffTool/tests/BaseTestCase.py\n@@ -18,7 +18,11 @@ def setUp(self):\n \n \n if six.PY2:\n- from plone.app.testing.bbb import PloneTestCase\n+ try:\n+ from plone.app.testing.bbb_at import PloneTestCase\n+ except ImportError:\n+ # plone.app.testing 5 or earlier\n+ from plone.app.testing.bbb import PloneTestCase\n from Products.CMFDiffTool.testing import CMFDiffToolATLayer\n \n class BaseATTestCase(PloneTestCase):\n'
b'diff --git a/CHANGES.rst b/CHANGES.rst\nindex 8384646..c8ad3ab 100644\n--- a/CHANGES.rst\n+++ b/CHANGES.rst\n@@ -20,6 +20,8 @@ Bug fixes:\n - *add item here*\n - Added get_objects_from_path_list to replace skin script. #1801\n [reinhardt]\n+- Added redirect_to_referrer to replace skin script. #1801\n+ [tlotze]\n \n \n 3.5.4 (2018-09-23)\ndiff --git a/plone/app/content/browser/content_status_history.py b/plone/app/content/browser/content_status_history.py\nindex efa382d..14eacd2 100644\n--- a/plone/app/content/browser/content_status_history.py\n+++ b/plone/app/content/browser/content_status_history.py\n@@ -128,3 +128,8 @@ def get_objects_from_path_list(self, paths=[]):\n if obj is not None:\n contents.append(obj)\n return contents\n+\n+ def redirect_to_referrer(self):\n+ referer = self.request.get(\'HTTP_REFERER\', \'\')\n+ target_url = referer.split(\'?\', 1)[0]\n+ return self.request.RESPONSE.redirect(target_url)\ndiff --git a/plone/app/content/browser/templates/content_status_history.pt b/plone/app/content/browser/templates/content_status_history.pt\nindex eb2cffc..8089871 100644\n--- a/plone/app/content/browser/templates/content_status_history.pt\n+++ b/plone/app/content/browser/templates/content_status_history.pt\n@@ -45,7 +45,7 @@\n dummy python:request.set(\'orig_template\', came_from);\n ">\n <metal:block tal:condition="python: paths and not batch"\n- tal:replace="python:context.redirectToReferrer(\'The item(s) you selected are no longer available.\')"/>\n+ tal:replace="view/redirect_to_referrer"/>\n \n <h1 class="documentFirstHeading"\n i18n:translate="heading_publishing_process">Publishing process</h1>\n'

0 comments on commit a714665

Please sign in to comment.