EPrints Technical Mailing List Archive

Message: #00799


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

[EP-tech] Patch: improve rendering names with empty givenname


Hi!

The attached patch renders names without a givenname as "surname"
instead of "surname, ".

Cheers,
--leo
-- 
e-mail   ::: Leo.Bergolth (at) wu.ac.at
fax      ::: +43-1-31336-906050
location ::: IT-Services | Vienna University of Economics | Austria

Index: perl_lib/EPrints/Utils.pm
===================================================================
--- perl_lib/EPrints/Utils.pm	(revision 5890)
+++ perl_lib/EPrints/Utils.pm	(working copy)
@@ -128,6 +128,7 @@
 {
 	my( $name, $familylast ) = @_;
 
+	return "" unless defined $name;
 	#EPrints::abort "make_name_string expected hash reference" unless ref($name) eq "HASH";
 	return "make_name_string expected hash reference" unless ref($name) eq "HASH";
 
@@ -158,7 +159,11 @@
 		return $firstbit." ".$secondbit;
 	}
 	
-	return $secondbit.", ".$firstbit;
+	if ($firstbit)
+	{
+		return $secondbit.", ".$firstbit;
+	}
+	return $secondbit;
 }