Replace deprecated setMetadata() that uses removed field names. #2956

Once upon a time, DSOs had dedicated fields for some metadata.  These were
moved into the Metadatavalue table long ago, but there were still methods
which used the old field names instead of proper MetadataField triplets.
This commit is contained in:
Mark H. Wood
2020-11-17 12:25:48 -05:00
parent 3e7ac5d935
commit e94911ba19
13 changed files with 163 additions and 166 deletions

View File

@@ -7,6 +7,8 @@
*/
package org.dspace.authenticate;
import static org.dspace.eperson.service.EPersonService.MD_PHONE;
import java.io.IOException;
import java.sql.SQLException;
import java.util.Arrays;
@@ -321,7 +323,8 @@ public class LDAPAuthentication
eperson.setLastName(context, ldap.ldapSurname);
}
if (StringUtils.isNotEmpty(ldap.ldapPhone)) {
ePersonService.setMetadata(context, eperson, "phone", ldap.ldapPhone);
ePersonService.setMetadataSingleValue(context, eperson,
MD_PHONE, ldap.ldapPhone, null);
}
eperson.setNetid(netid.toLowerCase());
eperson.setCanLogIn(true);