Skip to content

Commit

Permalink
Avoid traceback when transforming links on content type with no prima…
Browse files Browse the repository at this point in the history
…ry field

This refs #51
  • Loading branch information
laulaz committed Jul 21, 2020
1 parent 86c34b6 commit d8a627a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions news/51.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Avoid traceback when transforming links on content type with no primary field
[laulaz]
2 changes: 1 addition & 1 deletion plone/app/versioningbehavior/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def __call__(self):
if not version_id:
raise ValueError(u'Missing parameter on the request: version_id')

field_id = self.request.get('field_id', IPrimaryFieldInfo(self.context).fieldname)
field_id = self.request.get('field_id') or IPrimaryFieldInfo(self.context).fieldname
filename = self.request.get('filename')
do_not_stream = self.request.get('do_not_stream')

Expand Down

0 comments on commit d8a627a

Please sign in to comment.