Skip to content
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

Merged
merged 1 commit into from Jun 30, 2016

Conversation

marsaoua
Copy link
Contributor

@marsaoua marsaoua commented May 30, 2016

String title = itemService.getMetadataFirstValue(item, "dc", "title", null, Item.ANY);

title = title != null ? title : I18nUtil
.getMessage("jsp.general.untitled", context);
Copy link
Member

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).

@marsaoua
Copy link
Contributor Author

Thanks for the remarks, I made the corresponding changes.

@KevinVdV KevinVdV added this to the 6.0 milestone May 31, 2016
@@ -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();
Copy link
Member

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.

@tdonohue
Copy link
Member

+1 via code review. Very obvious fix. Thanks!

@tdonohue tdonohue added the quick win Pull request is small in size & should be easy to review and/or merge label Jun 30, 2016
@DylanMeeus
Copy link
Contributor

+1 via code review, looks like an obvious fix indeed 👍

@hardyoyo
Copy link
Member

+1 via code review

@tdonohue tdonohue merged commit e9f2f2d into DSpace:master Jun 30, 2016
4science-it pushed a commit to 4Science/DSpace that referenced this pull request Feb 16, 2024
[DSC-1386] Added support to create template item via struct builder

Approved-by: Stefano Maffei
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement quick win Pull request is small in size & should be easy to review and/or merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants