Skip to content

Commit

Permalink
Support getting /@querystring vocabs in context
Browse files Browse the repository at this point in the history
  • Loading branch information
davisagli committed Sep 19, 2023
1 parent ed19220 commit b1090cc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/plone/restapi/services/querystring/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@
permission="zope2.View"
name="@querystring"
/>

<plone:service
method="GET"
factory=".get.QuerystringGet"
for="Products.CMFCore.interfaces.IContentish"
permission="zope2.View"
name="@querystring"
/>

<cache:ruleset
for=".get.QuerystringGet"
ruleset="plone.content.dynamic"
Expand Down
2 changes: 1 addition & 1 deletion src/plone/restapi/services/querystring/get.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class QuerystringGet(Service):
def reply(self):
registry = getUtility(IRegistry)
reader = getMultiAdapter((registry, self.request), IQuerystringRegistryReader)

reader.vocab_context = self.context
result = reader()
result["@id"] = "%s/@querystring" % self.context.absolute_url()
return result

0 comments on commit b1090cc

Please sign in to comment.