Hi,

I have added a few of those null checks too over the time. It might be a good 
idea to fix this for all possible metadata fields. I opened an issue: 
https://github.com/DSpace/DSpace/issues/10581

Best regards,
Martin

> On 9. Apr 2025, at 12:44, 'Soukaïna Mahboub Mehboub' via DSpace Technical 
> Support <[email protected]> wrote:
> 
> Hi Tim, 
> 
> Thanks for the reply. i managed to fix the issue by modifying the source 
> files of DSpace 7.6. 
> 
> I chnaged Item.java file, I replaced: 
> 
> @Override
>     public String getName() {
>         return getItemService().getMetadataFirstValue(this, 
> MetadataSchemaEnum.DC.getName(), "title", null, Item.ANY);
>     }
>   By : 
> 
>  @Override
>     public String getName() {
>         String title = getItemService().getMetadataFirstValue(
>             this, MetadataSchemaEnum.DC.getName(), "title", null, Item.ANY
>         );
> 
>         // person.givenName + person.familyName
>         if (title == null || title.trim().isEmpty()) {
>             String givenName = getItemService().getMetadataFirstValue(
>                 this, MetadataSchemaEnum.PERSON.getName(), "givenName", null, 
> Item.ANY
>             );
>             String familyName = getItemService().getMetadataFirstValue(
>                 this, MetadataSchemaEnum.PERSON.getName(), "familyName", 
> null, Item.ANY
>             );
>             if (givenName == null) {
>                 givenName = "";
>             }
>             if (familyName == null) {
>                 familyName = "";
>             }
> 
>             title = (givenName + " " + familyName).trim();
>         }
> 
>         return title.isEmpty() ? "Untitled Submission" : title;
>     }
> 
> 
> Regards, 
> 
> 
> El dia divendres, 4 d’abril del 2025 a les 23:51:55 UTC+2, DSpace Technical 
> Support va escriure:
> Hello,
> 
> That behavior sounds like a possible bug to me.  The email templates 
> obviously shouldn't assume that all objects have a `dc.title` because Person 
> entities do *not* have a `dc.title` by default.
> 
> I'd recommend reporting this as a bug in our ticketing system at 
> https://github.com/DSpace/dspace/issues   Please add details about how you've 
> reproduced this behavior, so that developers can better understand what may 
> be going on.
> 
> Thanks,
> 
> Tim
> 
> On Thursday, March 27, 2025 at 6:19:34 AM UTC-5 
> [email protected] wrote:
> Hello community,
> I’ve set up a collection for entities of type “Person”, but I noticed it 
> doesn’t include the dc.title metadata. 
> Since dc.title is used to populate params[0] in the email template during 
> item submission, the title field in the email currently appears as 
> “params[0]” with no actual title, as the attached image shows. 
> Could you please advise a workaround to ensure the email template displays 
> the correct title?
> Thank you for your assistance.
> Best regards,
> 
> 
> 
> 
> -- 
> All messages to this mailing list should adhere to the Code of Conduct: 
> https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx
> --- 
> You received this message because you are subscribed to the Google Groups 
> "DSpace Technical Support" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion visit 
> https://groups.google.com/d/msgid/dspace-tech/6963b06f-988b-42af-b6c9-f0fa4ad5e78dn%40googlegroups.com.

-- 
All messages to this mailing list should adhere to the Code of Conduct: 
https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx
--- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/dspace-tech/D1A9D67F-F9D6-4C23-86F7-18AD89A22113%40tu-berlin.de.
  • [dspace-tech] How... 'Soukaïna Mahboub Mehboub' via DSpace Technical Support
    • [dspace-tech... DSpace Technical Support
      • [dspace-... 'Soukaïna Mahboub Mehboub' via DSpace Technical Support
        • Re: ... 'Walk, Martin' via DSpace Technical Support

Reply via email to