Skip to content

Commit

Permalink
fix returning of item_id if given.
Browse files Browse the repository at this point in the history
  • Loading branch information
jensens committed Aug 18, 2022
1 parent c1f3975 commit 37e421f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions news/16.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Fix returning of item_id if given in `pretty_title_or_id`.
Remove unused code and outdated comment.
[jensens]
2 changes: 2 additions & 0 deletions src/plone/base/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ def pretty_title_or_id(context, obj, empty_value=_marker):
item_id = getattr(obj, "getId", None)
if safe_callable(item_id):
item_id = item_id()
if item_id is not None:
return item_id
if empty_value is _marker:
empty_value = get_empty_title(context)
return empty_value
Expand Down

0 comments on commit 37e421f

Please sign in to comment.