Skip to content

Commit

Permalink
Merge pull request #38 from collective/erral-issue-37
Browse files Browse the repository at this point in the history
fix JSON call url
  • Loading branch information
wesleybl authored Mar 11, 2024
2 parents f7d359e + c9e5cb5 commit db508f2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ Changelog
3.0.0 (unreleased)
------------------

- Fix JSON call URL in non-rooted virtual host environments. Fixes #37
[erral]

- Drop support to Python 3.7.
[wesleybl]

Expand Down
7 changes: 6 additions & 1 deletion src/plone/formwidget/masterselect/widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,12 @@ def getSlaves(self):
yield slave.copy()

def renderJS(self):
url = '/'.join(self.request.physicalPathFromURL(self.request.getURL()))
url = "/".join(
[""]
+ self.request.physicalPathToVirtualPath(
self.request.physicalPathFromURL(self.request.getURL())
),
)
widgetURL = url + '/++widget++%s/@@masterselect-jsonvalue' % self.__name__

for slave in self.getSlaves():
Expand Down

0 comments on commit db508f2

Please sign in to comment.