Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for free_to_read causes EPrint::View not to load #28

Open
drn05r opened this issue May 29, 2015 · 3 comments
Open

Check for free_to_read causes EPrint::View not to load #28

drn05r opened this issue May 29, 2015 · 3 comments

Comments

@drn05r
Copy link
Contributor

drn05r commented May 29, 2015

On line 594 of zz_rioxx2.pl the following line causes the EPrints::View Screen plugin to fail to load for EPrint records that were created and have not been edited since the RIOXX2 plugin was installed:

unless( EPrints::Utils::is_set( $value->{free_to_read} ) )

The following error message is shown when the page fails to load is:

Can't use string ("0") as a HASH ref while "strict refs" in use at (eval 2377) line 594.

Suggesting that either $value is not defined as a HASH.

@drn05r
Copy link
Contributor Author

drn05r commented May 29, 2015

This may be due to using an earlier version of the RIOXX2 plugin that did not set this field to a sensible value when the plugin was installed and created this field in the eprint table. However, it would be helpful if the check for whether free_to_read is set is a little more fault tolerant, so whatever teh sate of the field it doesn't cause the EPrint::View screen plugin to fail to load.

@drn05r
Copy link
Contributor Author

drn05r commented May 29, 2015

I have used the following few lines as a catch for when this value is not properly set, prior to the unless( EPrints::Utils::is_set( $value->{free_to_read} ) ) line:

if ( ref($value) ne 'HASH' )
{
push @problems, $repo->html_phrase( "rioxx2_validate_rioxx2_free_to_read:not_done_part_free_to_read" );
return @problems;
}

@drtjmb
Copy link
Member

drtjmb commented Jun 19, 2015

Pull request please?

Tim

Timothy Miles-Board

Web & Repositories Development Specialist, University of London Computer Centre

020 7863 1342 | 07742 970 351 | timothy.miles-board@london.ac.ukmailto:timothy.miles-board@london.ac.uk | @drtjmb

The University of London is an exempt charity in England and Wales


From: David R Newman notifications@github.com
Sent: 29 May 2015 3:11 PM
To: eprintsug/rioxx2
Subject: Re: [rioxx2] Check for free_to_read causes EPrint::View not to load (#28)

I have used the following few lines as a catch for when this value is not properly set, prior to the unless( EPrints::Utils::is_set( $value->{free_to_read} ) ) line:

if ( ref($value) ne 'HASH' )
{
push @problemshttps://github.com/problems, $repo->html_phrase( "rioxx2_validate_rioxx2_free_to_read:not_done_part_free_to_read" );
return @problemshttps://github.com/problems;
}

Reply to this email directly or view it on GitHubhttps://github.com//issues/28#issuecomment-106819627.

drn05r added a commit to drn05r/rioxx2 that referenced this issue Jun 23, 2015
Addresses eprintsug#28
Probably due to pre-RIOXX2 eprints that have had embargoes that have expired.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants