EPrints Technical Mailing List Archive

See the EPrints wiki for instructions on how to join this mailing list and related information.

Message: #09700


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

[EP-tech] Resolved: Automatic fields


CAUTION: This e-mail originated outside the University of Southampton.

Realise I’d accidentally dragged this one off the list.

 

Turns out that, somewhere in the upgrading, we’d managed to replicate line 1087 into line 1097 of Eprint.pm, causing the call to update_triggers to only happen the first time an item was pushed to archive status…

 

https://github.com/eprints/eprints3.4/blob/83881eb7c72e56e82cb9d86af6831831af5e64ee/perl_lib/EPrints/DataObj/EPrint.pm#L1098

 

Now sorted – I suppose it was something daft, if not obvious!

Alan

 

From: Alan.Stiles [He/Him/They] <alan.stiles@open.ac.uk>
Date: Friday, 12 April 2024 at 12:02
To: David R Newman <drn@ecs.soton.ac.uk>
Subject: Re: [EP-tech] Automatic fields

Thanks for confirming I’m not just doing something obviously daft – I’ll have another dig through and see if I can figure out what’s happening.

 

Alan

 

From: David R Newman <drn@ecs.soton.ac.uk>
Date: Friday, 12 April 2024 at 11:47
To: Alan.Stiles [He/Him/They] <alan.stiles@open.ac.uk>
Subject: Re: [EP-tech] Automatic fields

Hi Alan,

If you have a cfg.d/eprint_fields_automatic.pl at archive level as well as the one under pub_lib the former will be applied and the latter will not.  I don't believe that the status of the eprint should affect whether set_eprint_automatic_fields is applied.  In fact the eprint in bold here determines the dataset to apply this to, which would means all eprints independent of status.  You could try writing this code as an update_trigger (in a separate config file) instead but this should not be needed.  However, if this does not work either then you have a different issue rather than your archive version of cfg.d/eprint_fields_automatic.pl not being applied.

Regards

David Newman

On 12/04/2024 11:30, Alan.Stiles [He/Him/They] wrote:

CAUTION: This e-mail originated outside the University of Southampton.

Hi David,

Yes, I can’t see anything in the error logs, except when I deliberately put some bad code into the archive version where the error showed up on Apache restart.

 

I wasn’t sure if the addition of the pub_lib version meant I had to do something else to get the archive version to be picked up.  I’ve even tried removing almost everything from the function to no avail.

 

$c->{set_eprint_automatic_fields} = sub

{

        my( $eprint ) = @_;

        $eprint->set_value( "title", $eprint->get_value( "title" )."X");

};

 

 

The status of the eprint has no bearing on the function being called, does it?

 

Alan

 

From: David R Newman <drn@ecs.soton.ac.uk>
Date: Friday, 12 April 2024 at 10:50
To:
eprints-tech@ecs.soton.ac.uk <eprints-tech@ecs.soton.ac.uk>, Alan.Stiles [He/Him/They] <alan.stiles@open.ac.uk>
Subject: Re: [EP-tech] Automatic fields

Hi Alan,

I have Just checked on my development instance running GitHub HEAD and I can see the default flavours/pub_lib/cfg.d/eprint_fields_automatic.pl has config to set the ispublished field to unpub if it is not set and the type is thesis and I can see that this works.  I assume you have checked your webserver error logs to make sure that something is not breaking?

Regards

David Newman

 

On 11/04/2024 17:27, Alan.Stiles [He/Him/They] wrote:

CAUTION: This e-mail originated outside the University of Southampton.

CAUTION: This e-mail originated outside the University of Southampton.

Recently upgraded to 3.4.5 (RHEL 9) and it seems as though the system isn’t processing the eprint_automatic_field entry from <EPRINTS_HOME>/archives/<ARCHIVEID>/cfg/cfg.d/eprint_fields_automatic.pl

 

$c->{set_eprint_automatic_fields} = sub

{

        my( $eprint ) = @_;

}

 

 

Did something change between 3.3.16 and 3.4.5 that affects how this should work, or any pointers about the code to check?

 

Thanks,

Alan

 

 

 

*** Options: https://wiki.eprints.org/w/Eprints-tech_Mailing_List
*** Archive: https://www.eprints.org/tech.php/
*** EPrints community wiki: https://wiki.eprints.org/