How can I change email template parameters? DSpace 7.6

35 views
Skip to first unread message

Soukaïna Mahboub Mehboub

unread,
Mar 27, 2025, 7:19:34 AM3/27/25
to DSpace Technical Support

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,




Captura.PNG

DSpace Technical Support

unread,
Apr 4, 2025, 5:51:55 PM4/4/25
to DSpace Technical Support
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

Soukaïna Mahboub Mehboub

unread,
Apr 9, 2025, 6:44:11 AM4/9/25
to DSpace Technical Support
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:

Walk, Martin

unread,
Apr 9, 2025, 7:49:38 AM4/9/25
to Soukaïna Mahboub Mehboub, DSpace Technical Support
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
> --
> 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 dspace-tech...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/dspace-tech/6963b06f-988b-42af-b6c9-f0fa4ad5e78dn%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages