Skip to content

Commit

Permalink
fix JSON call url
Browse files Browse the repository at this point in the history
  • Loading branch information
erral committed Oct 20, 2022
1 parent 7f43d4e commit b11d294
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Changelog
2.0.2 (unreleased)
------------------

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


2.0.1 (2021-09-16)
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 b11d294

Please sign in to comment.