EPrints Technical Mailing List Archive
See the EPrints wiki for instructions on how to join this mailing list and related information.
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
- To: eprints-tech@ecs.soton.ac.uk
- Subject: [EP-tech] Patch: improve rendering names with empty givenname
- From: "Alexander 'Leo' Bergolth" <leo@strike.wu.ac.at>
- Date: Tue, 26 Jun 2012 19:04:21 +0200
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; }
- Follow-Ups:
- [EP-tech] Re: Patch: improve rendering names with empty givenname
- From: Tim Brody <tdb2@ecs.soton.ac.uk>
- [EP-tech] Re: Patch: improve rendering names with empty givenname
- Prev by Date: [EP-tech] Re: Tracking item accesses
- Next by Date: [EP-tech] Patch: handle NULL values in EPrints::Search::Condition::Comparison
- Previous by thread: [EP-tech] Tracking item accesses
- Next by thread: [EP-tech] Re: Patch: improve rendering names with empty givenname
- Index(es):