Skip to content

Commit

Permalink
fix NoneType context
Browse files Browse the repository at this point in the history
  • Loading branch information
petschki committed Nov 8, 2024
1 parent d5e67ce commit c8d97de
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plone/app/z3cform/widgets/link.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ class LinkWidget(HTMLTextInputWidget, Widget):
"""

def pattern_data(self):
context = self.context or getSite()
pattern_data = {
"vocabularyUrl": "{}/@@getVocabulary?name=plone.app.vocabularies.Catalog".format( # noqa
getSite().absolute_url(0),
),
"rootPath": "/".join(getSite().getPhysicalPath()),
"basePath": "/".join(self.context.getPhysicalPath()),
"basePath": "/".join(context.getPhysicalPath()),
"maximumSelectionSize": 1,
}
return json.dumps(pattern_data)
Expand Down

0 comments on commit c8d97de

Please sign in to comment.