Skip to content

Commit

Permalink
NBBIB-461 Add consideration for single initial
Browse files Browse the repository at this point in the history
  • Loading branch information
camilocodes committed Aug 19, 2024
1 parent efa5d5c commit fe4e0be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom/modules/nbbib_util/script/format_initials.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function format_initials($type) {
$lastchar = substr($first_name, -1);
$prevchar = substr($first_name, -2, 1);

if (ctype_alpha($lastchar) && $prevchar == ' ') {
if (ctype_alpha($lastchar) && ($prevchar == ' ' or $prevchar == '' )) {
echo "\nUpdating contributor [$first_name $last_name] -> [$first_name. $last_name]";
$entity->setFirstName("$first_name.");
$entity->save();
Expand Down

0 comments on commit fe4e0be

Please sign in to comment.