# HG changeset patch # User Thierry Florac # Date 1529664730 -7200 # Node ID 9a3eda154460f2a9ae5a3578f3b0c5b1b190c75b # Parent ff35457b30a6407dbbb00b2b7b8757cdce4b7b29 Use relative URL in internal links diff -r ff35457b30a6 -r 9a3eda154460 src/pyams_content/component/links/__init__.py --- a/src/pyams_content/component/links/__init__.py Thu Jun 21 16:58:29 2018 +0200 +++ b/src/pyams_content/component/links/__init__.py Fri Jun 22 12:52:10 2018 +0200 @@ -9,6 +9,7 @@ # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. # +from pyams_skin.layer import IPyAMSUserLayer __docformat__ = 'restructuredtext' @@ -35,7 +36,7 @@ from pyams_utils.registry import query_utility from pyams_utils.request import check_request from pyams_utils.traversing import get_parent -from pyams_utils.url import absolute_url +from pyams_utils.url import absolute_url, relative_url from pyams_utils.vocabulary import vocabulary_config from pyams_utils.zodb import volatile_property from zope.interface import implementer @@ -132,11 +133,11 @@ return 'oid://{0}'.format(self.reference) def get_url(self, request=None, view_name=None): - target = self.get_target(state=VISIBLE_STATES) + target = self.get_target() if target is not None: if request is None: request = check_request() - return absolute_url(target, request, view_name) + return relative_url(target, request, view_name=view_name) else: return ''