EPrints Technical Mailing List Archive
Message: #06083
< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First
Re: [EP-tech] Debug Creator browse view generation
- To: "eprints-tech@ecs.soton.ac.uk" <eprints-tech@ecs.soton.ac.uk>
- Subject: Re: [EP-tech] Debug Creator browse view generation
- From: Andrew Beeken <anbeeken@lincoln.ac.uk>
- Date: Wed, 16 Nov 2016 10:59:24 +0000
Thanks both! It looks like the issue here is a data issue. A function in Authorid.pm has had some code added to it which checks against a database table for users which are no longer at the institution, however it doesn’t seem to be able to cope with
a user that isn’t present in that table. The function is: sub get_value_label { my( $self, $session, $value ) = @_; my $user = EPrints::DataObj::User->new( $session, $value ); #Checks the normal process and returns the user if found. if( defined $user ) { return $session->make_text( EPrints::Utils::make_name_string( $self->_get_name( $session, $user ) ) ); } #If not returned with normal user checks value is a valid number and trys to pull the user from the ldap_user table instead if ($value =~ /^[+-]?\d+$/ ) { if (scalar @{$session->get_database->search_sql_ldap($value)}){ << THIS IS THE LINE THAT’S GIVING ME GRIEF! my @check = @{$session->get_database->search_sql_ldap($value)};
if(defined($check[0][0]) && defined($check[0][1])) { my $string_build = $check[0][0] . ", " . $check[0][1]; return $session->make_text( $string_build ); } } } #Otherwise just simply output the value return $session->make_text( $value ); #return $session->make_text( "me" ); } …and I’ve marked the problematic line of code. When it encounters an empty string instead of a scalar, the view generator goes… ¯\_(ツ)_/¯ …and falls over. Giving us no generated views. And a 500 error. Which is nice. So, I think the answer is to handle that empty string and let the function carry on to the fallback of returning the value, however my knowledge of perl is less than functional at best and I really don’t want to do any more irrevocable
damage. Any thoughts would be welcome! Andrew From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk]
On Behalf Of John Salter > bin/generate_views ARCHIVEID --view viewid --verbose (You can do ‘--verbose --verbose’ if you really need to!). Depending on where your issue lies, you might want to use one of these options too: --generate menus --generate lists Which will be a bit quicker than a full run. Cheers, John From:
eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk]
On Behalf Of Andrew Beeken Hello all! So, back to that old chestnut of errors throwing in our EPrints installation (yay!) I’ve had to do some tweaks to make it read our LDAP table. Now I’m getting errors on the creator browse generation! I think I’ve figured out where the problems
are occurring however I don’t know if it’s a code issue or a data issue. Is there a way of running the view generator from the command line with –verbose so that I can see what it’s trying to do and figure out where the error is occurring? Andrew
|
- References:
- [EP-tech] Debug Creator browse view generation
- From: Andrew Beeken <anbeeken@lincoln.ac.uk>
- Re: [EP-tech] Debug Creator browse view generation
- From: John Salter <J.Salter@leeds.ac.uk>
- [EP-tech] Debug Creator browse view generation
- Prev by Date: Re: [EP-tech] Debug Creator browse view generation
- Next by Date: Re: [EP-tech] Debug Creator browse view generation
- Previous by thread: Re: [EP-tech] Debug Creator browse view generation
- Next by thread: Re: [EP-tech] Debug Creator browse view generation
- Index(es):