New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include the item's title in the request item e-mail just for xmlui #1422
Conversation
String title = itemService.getMetadataFirstValue(item, "dc", "title", null, Item.ANY); | ||
|
||
title = title != null ? title : I18nUtil | ||
.getMessage("jsp.general.untitled", context); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it not be better to use item.getName() (https://github.com/DSpace/DSpace/blob/master/dspace-api/src/main/java/org/dspace/content/Item.java#L334) & then use StringUtils.isNotBlank() instead of a null check (this will ensure a blank title ("") is also sent as untitled).
Thanks for the remarks, I made the corresponding changes. |
@@ -55,6 +56,7 @@ | |||
protected HandleService handleService = HandleServiceFactory.getInstance().getHandleService(); | |||
protected RequestItemService requestItemService = RequestItemServiceFactory.getInstance().getRequestItemService(); | |||
protected BitstreamService bitstreamService = ContentServiceFactory.getInstance().getBitstreamService(); | |||
protected ItemService itemService = ContentServiceFactory.getInstance().getItemService(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unclear why itemService is being grabbed here (or why there's an import org.dspace.content.service.ItemService;
above). It looks like it never gets used in this class, so there's no need to even pull it in.
+1 via code review. Very obvious fix. Thanks! |
+1 via code review, looks like an obvious fix indeed 👍 |
+1 via code review |
[DSC-1386] Added support to create template item via struct builder Approved-by: Stefano Maffei
https://jira.duraspace.org/browse/DS-3225