-
-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fc] Repository: Products.LinguaPlone
Branch: refs/heads/master Date: 2016-01-25T11:59:02+01:00 Author: Johannes Raggam (thet) <thetetet@gmail.com> Commit: plone/Products.LinguaPlone@404bfcd all lowercase "remove" in uninstall profile. doesnt matter, but... Files changed: M Products/LinguaPlone/profiles/uninstall/browserlayer.xml M Products/LinguaPlone/profiles/uninstall/catalog.xml M Products/LinguaPlone/profiles/uninstall/componentregistry.xml M Products/LinguaPlone/profiles/uninstall/kssregistry.xml M Products/LinguaPlone/profiles/uninstall/reference_catalog.xml M Products/LinguaPlone/profiles/uninstall/skins.xml M Products/LinguaPlone/profiles/uninstall/uid_catalog.xml
- Loading branch information
Showing
1 changed file
with
102 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,128 +1,110 @@ | ||
Repository: plone.app.linkintegrity | ||
Repository: Products.LinguaPlone | ||
|
||
|
||
Branch: refs/heads/1.5.x | ||
Date: 2016-01-21T17:00:24+01:00 | ||
Author: tschorr (tschorr) <t_schorr@gmx.de> | ||
Commit: https://github.com/plone/plone.app.linkintegrity/commit/16639ddff0849653abc33a9bc0d3b22ae3d34266 | ||
Branch: refs/heads/master | ||
Date: 2016-01-25T11:59:02+01:00 | ||
Author: Johannes Raggam (thet) <thetetet@gmail.com> | ||
Commit: https://github.com/plone/Products.LinguaPlone/commit/404bfcdf6f41ecb7a2ac3c1eefbefac5ed96b7fa | ||
|
||
fix findObjects for the case where the webserver rewrites the portal name | ||
all lowercase "remove" in uninstall profile. doesnt matter, but... | ||
|
||
Files changed: | ||
M CHANGES.rst | ||
M plone/app/linkintegrity/handlers.py | ||
M plone/app/linkintegrity/tests/test_handlers.py | ||
M Products/LinguaPlone/profiles/uninstall/browserlayer.xml | ||
M Products/LinguaPlone/profiles/uninstall/catalog.xml | ||
M Products/LinguaPlone/profiles/uninstall/componentregistry.xml | ||
M Products/LinguaPlone/profiles/uninstall/kssregistry.xml | ||
M Products/LinguaPlone/profiles/uninstall/reference_catalog.xml | ||
M Products/LinguaPlone/profiles/uninstall/skins.xml | ||
M Products/LinguaPlone/profiles/uninstall/uid_catalog.xml | ||
|
||
diff --git a/CHANGES.rst b/CHANGES.rst | ||
index 779b21d..52cedcd 100644 | ||
--- a/CHANGES.rst | ||
+++ b/CHANGES.rst | ||
@@ -12,7 +12,8 @@ New: | ||
Fixes: | ||
|
||
- *add item here* | ||
- | ||
+- make handler.findObject() work when the webserver rewrites the portal name | ||
+ [tschorr] | ||
|
||
1.5.7 (2015-11-17) | ||
------------------ | ||
diff --git a/plone/app/linkintegrity/handlers.py b/plone/app/linkintegrity/handlers.py | ||
index 2841dbc..b1f4426 100644 | ||
--- a/plone/app/linkintegrity/handlers.py | ||
+++ b/plone/app/linkintegrity/handlers.py | ||
@@ -65,7 +65,7 @@ def findObject(base, path): | ||
if path.startswith('/'): | ||
# Make an absolute path relative to the portal root | ||
obj = getToolByName(base, 'portal_url').getPortalObject() | ||
- portal_path = '/'.join(obj.getPhysicalPath()) + '/' | ||
+ portal_path = obj.absolute_url_path() + '/' | ||
if path.startswith(portal_path): | ||
path = path[len(portal_path):] | ||
else: | ||
diff --git a/plone/app/linkintegrity/tests/test_handlers.py b/plone/app/linkintegrity/tests/test_handlers.py | ||
index 79652ff..9891837 100644 | ||
--- a/plone/app/linkintegrity/tests/test_handlers.py | ||
+++ b/plone/app/linkintegrity/tests/test_handlers.py | ||
@@ -23,3 +23,14 @@ def test_relative_to_portal_root_2(self): | ||
obj, components = findObject(self.portal.doc1, '/doc2') | ||
self.assertEqual(obj.absolute_url_path(), '/plone/doc2') | ||
self.assertEqual(components, '') | ||
+ | ||
+ def test_webserver_rewrites_portal_name(self): | ||
+ # test the case where a webserver rewrites the portal name, e.g. for Apache: | ||
+ # RewriteRule ^/wssitename(.*)$ http://localhost:8080/VirtualHostBase/http/my.domain.com:80/plonesitename/VirtualHostRoot/_vh_wssitename$1 | ||
+ self.portal.REQUEST.other['VirtualRootPhysicalPath'] = ('', 'plone') | ||
+ self.portal.REQUEST._script = ['plone_foo'] | ||
+ obj, components = findObject(self.portal.doc1, '/plone_foo/doc2') | ||
+ self.assertEqual(obj.absolute_url_path(), '/plone_foo/doc2') | ||
+ self.assertEqual(obj.getPhysicalPath(), ('','plone', 'doc2')) | ||
+ self.assertEqual(components, '') | ||
+ | ||
|
||
|
||
Repository: plone.app.linkintegrity | ||
|
||
|
||
Branch: refs/heads/1.5.x | ||
Date: 2016-01-22T12:12:40+01:00 | ||
Author: Philip Bauer (pbauer) <bauer@starzel.de> | ||
Commit: https://github.com/plone/plone.app.linkintegrity/commit/564b676f0e6d3347939a7d4fa7d4549f1a047ff4 | ||
|
||
Merge pull request #34 from plone/rewritten_portal_name_1.5.x_pr | ||
|
||
Make findObject work if the webserver rewrites the portal name | ||
|
||
Files changed: | ||
M CHANGES.rst | ||
M plone/app/linkintegrity/handlers.py | ||
M plone/app/linkintegrity/tests/test_handlers.py | ||
|
||
diff --git a/CHANGES.rst b/CHANGES.rst | ||
index 779b21d..52cedcd 100644 | ||
--- a/CHANGES.rst | ||
+++ b/CHANGES.rst | ||
@@ -12,7 +12,8 @@ New: | ||
Fixes: | ||
|
||
- *add item here* | ||
- | ||
+- make handler.findObject() work when the webserver rewrites the portal name | ||
+ [tschorr] | ||
|
||
1.5.7 (2015-11-17) | ||
------------------ | ||
diff --git a/plone/app/linkintegrity/handlers.py b/plone/app/linkintegrity/handlers.py | ||
index 2841dbc..b1f4426 100644 | ||
--- a/plone/app/linkintegrity/handlers.py | ||
+++ b/plone/app/linkintegrity/handlers.py | ||
@@ -65,7 +65,7 @@ def findObject(base, path): | ||
if path.startswith('/'): | ||
# Make an absolute path relative to the portal root | ||
obj = getToolByName(base, 'portal_url').getPortalObject() | ||
- portal_path = '/'.join(obj.getPhysicalPath()) + '/' | ||
+ portal_path = obj.absolute_url_path() + '/' | ||
if path.startswith(portal_path): | ||
path = path[len(portal_path):] | ||
else: | ||
diff --git a/plone/app/linkintegrity/tests/test_handlers.py b/plone/app/linkintegrity/tests/test_handlers.py | ||
index 79652ff..9891837 100644 | ||
--- a/plone/app/linkintegrity/tests/test_handlers.py | ||
+++ b/plone/app/linkintegrity/tests/test_handlers.py | ||
@@ -23,3 +23,14 @@ def test_relative_to_portal_root_2(self): | ||
obj, components = findObject(self.portal.doc1, '/doc2') | ||
self.assertEqual(obj.absolute_url_path(), '/plone/doc2') | ||
self.assertEqual(components, '') | ||
+ | ||
+ def test_webserver_rewrites_portal_name(self): | ||
+ # test the case where a webserver rewrites the portal name, e.g. for Apache: | ||
+ # RewriteRule ^/wssitename(.*)$ http://localhost:8080/VirtualHostBase/http/my.domain.com:80/plonesitename/VirtualHostRoot/_vh_wssitename$1 | ||
+ self.portal.REQUEST.other['VirtualRootPhysicalPath'] = ('', 'plone') | ||
+ self.portal.REQUEST._script = ['plone_foo'] | ||
+ obj, components = findObject(self.portal.doc1, '/plone_foo/doc2') | ||
+ self.assertEqual(obj.absolute_url_path(), '/plone_foo/doc2') | ||
+ self.assertEqual(obj.getPhysicalPath(), ('','plone', 'doc2')) | ||
+ self.assertEqual(components, '') | ||
+ | ||
diff --git a/Products/LinguaPlone/profiles/uninstall/browserlayer.xml b/Products/LinguaPlone/profiles/uninstall/browserlayer.xml | ||
index e9d85d8..0e976eb 100644 | ||
--- a/Products/LinguaPlone/profiles/uninstall/browserlayer.xml | ||
+++ b/Products/LinguaPlone/profiles/uninstall/browserlayer.xml | ||
@@ -1,7 +1,3 @@ | ||
<layers> | ||
- <layer | ||
- remove="True" | ||
- name="LinguaPlone" | ||
- interface="Products.LinguaPlone.interfaces.ILinguaPloneProductLayer" | ||
- /> | ||
+ <layer remove="true" name="LinguaPlone"/> | ||
</layers> | ||
diff --git a/Products/LinguaPlone/profiles/uninstall/catalog.xml b/Products/LinguaPlone/profiles/uninstall/catalog.xml | ||
index a21dd57..1aaea23 100644 | ||
--- a/Products/LinguaPlone/profiles/uninstall/catalog.xml | ||
+++ b/Products/LinguaPlone/profiles/uninstall/catalog.xml | ||
@@ -1,4 +1,4 @@ | ||
<?xml version="1.0"?> | ||
<object name="portal_catalog"> | ||
- <column value="Language" remove="True"/> | ||
+ <column remove="true" value="Language"/> | ||
</object> | ||
diff --git a/Products/LinguaPlone/profiles/uninstall/componentregistry.xml b/Products/LinguaPlone/profiles/uninstall/componentregistry.xml | ||
index 3255718..39b5085 100644 | ||
--- a/Products/LinguaPlone/profiles/uninstall/componentregistry.xml | ||
+++ b/Products/LinguaPlone/profiles/uninstall/componentregistry.xml | ||
@@ -3,11 +3,11 @@ | ||
<adapters/> | ||
<utilities> | ||
<utility | ||
- remove="True" | ||
+ remove="true" | ||
interface="plone.i18n.locales.interfaces.IContentLanguageAvailability" | ||
factory="Products.LinguaPlone.vocabulary.SyncedLanguages"/> | ||
<utility | ||
- remove="True" | ||
+ remove="true" | ||
interface="plone.i18n.locales.interfaces.IMetadataLanguageAvailability" | ||
factory="Products.LinguaPlone.vocabulary.SyncedLanguages"/> | ||
</utilities> | ||
diff --git a/Products/LinguaPlone/profiles/uninstall/kssregistry.xml b/Products/LinguaPlone/profiles/uninstall/kssregistry.xml | ||
index aa793c0..fb60aaf 100644 | ||
--- a/Products/LinguaPlone/profiles/uninstall/kssregistry.xml | ||
+++ b/Products/LinguaPlone/profiles/uninstall/kssregistry.xml | ||
@@ -1,4 +1,4 @@ | ||
<?xml version="1.0"?> | ||
<object name="portal_kss" meta_type="KSS Registry"> | ||
- <kineticstylesheet remove="True" id="linguaplone.kss"/> | ||
+ <kineticstylesheet remove="true" id="linguaplone.kss"/> | ||
</object> | ||
diff --git a/Products/LinguaPlone/profiles/uninstall/reference_catalog.xml b/Products/LinguaPlone/profiles/uninstall/reference_catalog.xml | ||
index 4487449..58d6311 100644 | ||
--- a/Products/LinguaPlone/profiles/uninstall/reference_catalog.xml | ||
+++ b/Products/LinguaPlone/profiles/uninstall/reference_catalog.xml | ||
@@ -1,4 +1,4 @@ | ||
<?xml version="1.0"?> | ||
<object name="reference_catalog"> | ||
- <column value="Language" remove="True"/> | ||
+ <column remove="true" value="Language"/> | ||
</object> | ||
diff --git a/Products/LinguaPlone/profiles/uninstall/skins.xml b/Products/LinguaPlone/profiles/uninstall/skins.xml | ||
index d7d7b6c..ba42155 100644 | ||
--- a/Products/LinguaPlone/profiles/uninstall/skins.xml | ||
+++ b/Products/LinguaPlone/profiles/uninstall/skins.xml | ||
@@ -1,9 +1,7 @@ | ||
<?xml version="1.0"?> | ||
<object name="portal_skins"> | ||
- <object name="LinguaPlone" meta_type="Filesystem Directory View" | ||
- directory="Products.LinguaPlone:skins/LinguaPlone" | ||
- remove="True"/> | ||
- <skin-path name="*"> | ||
- <layer name="LinguaPlone" remove="True" /> | ||
- </skin-path> | ||
+ <object remove="true" name="LinguaPlone" meta_type="Filesystem Directory View" directory="Products.LinguaPlone:skins/LinguaPlone"/> | ||
+ <skin-path name="*"> | ||
+ <layer remove="true" name="LinguaPlone"/> | ||
+ </skin-path> | ||
</object> | ||
diff --git a/Products/LinguaPlone/profiles/uninstall/uid_catalog.xml b/Products/LinguaPlone/profiles/uninstall/uid_catalog.xml | ||
index d0ce76f..f2183fd 100644 | ||
--- a/Products/LinguaPlone/profiles/uninstall/uid_catalog.xml | ||
+++ b/Products/LinguaPlone/profiles/uninstall/uid_catalog.xml | ||
@@ -1,4 +1,4 @@ | ||
<?xml version="1.0"?> | ||
<object name="uid_catalog"> | ||
- <index name="Language" meta_type="FieldIndex" remove="True"/> | ||
+ <index remove="true" name="Language" meta_type="FieldIndex"/> | ||
</object> | ||
|
||
|