EPrints Technical Mailing List Archive

Message: #05108


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

[EP-tech] Re: issue with on-behalf-of when depositing using SWORD 2


Hi Adam

Thanks for looking into, I'd be happy to help on Wednesday but as mentioned my technical ability around PERL is limited. But I'll help in any other way I can.

Regards

Simon

-----Original Message-----
From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of Field A.N.
Sent: Friday 13 November 2015 15:35
To: eprints-tech@ecs.soton.ac.uk
Subject: [EP-tech] Re: issue with on-behalf-of when depositing using SWORD 2

Ugh -- this is an ugly bug.  It should be:

	$self->sword_error(...)

...but the calls on lines 1847 and 1849 are in a function that doesn't have $self defined.  I made an attempt to fix it, but it needs someone to look at it properly in a dev environment.

Different bits of the code are calling it incorrectly, but also they're misusing the return value of the function.  I would guess that you're the first person to try to use this part of the code.  The SWORD interface doesn't get an awful lot of use, AFAIK.

I've opened an issue: https://github.com/eprints/eprints/issues/360

Perhaps you'd like to get involved with sorting out this issue on Wednesday's Community Contribution Day...  See http://wiki.eprints.org/w/Community_Contributions_Day_November_2015

--
Adam Field
Business Relationship Manager and Community Lead EPrints Services
+44 (0)23 8059 8814





On 12 Nov 2015, at 17:09, Simon Cullen wrote:

> Hi Adam
> 
> Thanks for getting back to me. I removed the two arguments into the sword_error subroutine but I am now getting the error message:
> Can't locate object method "request" via package "summary" (perhaps you forgot to load "summary"?) at /usr/share/eprints/perl_lib/EPrints/Apache/CRUD.pm line 1976.
> 
> Unfortunately I don't know PERL well at all - Any other thoughts?
> 
> Regards
> 
> Simon
> 
> -----Original Message-----
> From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of Field A.N.
> Sent: Thursday 12 November 2015 16:44
> To: eprints-tech@ecs.soton.ac.uk
> Subject: [EP-tech] Re: issue with on-behalf-of when depositing using 
> SWORD 2
> 
> This looks like a fairly simple bug at these lines:
> 
> https://github.com/eprints/eprints/blob/de3b8d19f310efdbd993d07e9dfd57
> a15e103354/perl_lib/EPrints/Apache/CRUD.pm#L1735
> https://github.com/eprints/eprints/blob/de3b8d19f310efdbd993d07e9dfd57
> a15e103354/perl_lib/EPrints/Apache/CRUD.pm#L1847
> https://github.com/eprints/eprints/blob/de3b8d19f310efdbd993d07e9dfd57
> a15e103354/perl_lib/EPrints/Apache/CRUD.pm#L1849
> 
> Each line has a call that looks like these:
> 
> 	sword_error( $repo, $r, %$on_behalf_of );
> 	sword_error($repo, $r, %$err )
> 
> ...What's important is that the first two arguments should not be being passed, only the third one.  Change to:
> 
> 	sword_error(%$on_behalf_of );
> 	sword_error(%$err )
> 
> Remove those and test it -- it should work.  If it does, please submit an issue on github.
> 
> --
> Adam Field
> Business Relationship Manager and Community Lead EPrints Services
> +44 (0)23 8059 8814
> 
> 
> 
> 
> 
> On 12 Nov 2015, at 16:28, Simon Cullen wrote:
> 
>> Hi
>> 
>> I am uploading to ePrints using a SWORD interface. I include “on-behalf-of” in the header and passing through the ePrints username. In instances where either:
>> ·         The depositing user does not have “user/mediate” permission OR
>> ·         the depositing user does not exist in the ePrints database
>> 
>> when I look into the Apache logs on the ePrints server I see the following:
>> 
>> Can't locate object method "repository" via package "EPrints::Repository" at /usr/share/eprints/perl_lib/EPrints/Apache/CRUD.pm line 1977.
>> 
>> Can some please advise on the issue.
>> 
>> Regards
>> Simon Cullen
>> 
>> Director
>> 
>> <image003.png>
>> 
>> T:   + 353 (0) 1 5242400
>> F:   + 353 (0) 1 4430773
>> M: + 353 87 2723462
>> E:   simon.cullen@vidatum.com   
>> www.vidatum.com
>> 
>> *** Options: 
>> http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
>> *** Archive: http://www.eprints.org/tech.php/
>> *** EPrints community wiki: http://wiki.eprints.org/
>> *** EPrints developers Forum: http://forum.eprints.org/
> 
> 
> *** Options: 
> http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
> *** Archive: http://www.eprints.org/tech.php/
> *** EPrints community wiki: http://wiki.eprints.org/
> *** EPrints developers Forum: http://forum.eprints.org/
> 
> *** Options: 
> http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
> *** Archive: http://www.eprints.org/tech.php/
> *** EPrints community wiki: http://wiki.eprints.org/
> *** EPrints developers Forum: http://forum.eprints.org/


*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** Archive: http://www.eprints.org/tech.php/
*** EPrints community wiki: http://wiki.eprints.org/
*** EPrints developers Forum: http://forum.eprints.org/