EPrints Technical Mailing List Archive

Message: #06488

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

[EP-tech] Does 'can_clone' work correctly?

Hi All,





Anyone have any ideas how to set a field parameter as ‘can_clone=>0’ for field definitions within the eprints_fields.pl file?


We have some fields that are visible to editorial staff only, which flag various details about the items in the repository.

The problem is, when an item is cloned, these extra ‘unknown to the end user’ fields are also cloned and set, with what appear to be valid notes/data…


I thought the ‘can_clone’ property would stop these data fields from being copied across, but alas, nothing I have tried has appeared to work.


I would rather not have to disable the clone button, but if that’s the only option then that’s how I have to do it…









From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of Matthew Brady
Sent: Friday, 28 April 2017 5:00 PM
To: eprints-tech@ecs.soton.ac.uk
Subject: [EP-tech] Does 'can_clone' work correctly?




Just wondering if anyone else can verify a problem I am having, (or doing wrong) on a 3.3.10 instance…


According to the documentation (https://wiki.eprints.org/w/Metadata), can_clone is a property that can be set in the field definitions, and is used quite liberally in the EPrints.pm : get_system_field_info sub


{ name=>"datestamp", type=>"time", required=>0, import=>0,

              render_res=>"minute", render_style=>"short", can_clone=>0 },


       { name=>"lastmod", type=>"timestamp", required=>0, import=>0,

              render_res=>"minute", render_style=>"short", can_clone=>0, volatile=>1 },


       { name=>"status_changed", type=>"time", required=>0, import=>0,

              render_res=>"minute", render_style=>"short", can_clone=>0 },




to filter out data you don’t want to copy across when cloning…


foreach my $field ( $self->{dataset}->get_fields )


              next if( $field->get_property( "can_clone" ) );

              delete $data->{$field->get_name};




Taking this a step further, I have altered the local repository eprint_fields.pl field definitions, to include the can_clone => 0 into a few test fields, but the data still gets cloned into the new record.


{name => 'test_field_1',         

 type => 'set',

 options => ['yes','no','pending'],

 can_clone => 0,



Can anyone confirm if it’s not working correctly, or point me to what I’m doing wrong ?





This email (including any attached files) is confidential and is for the intended recipient(s) only. If you received this email by mistake, please, as a courtesy, tell the sender, then delete this email.

The views and opinions are the originator's and do not necessarily reflect those of the University of Southern Queensland. Although all reasonable precautions were taken to ensure that this email contained no viruses at the time it was sent we accept no liability for any losses arising from its receipt.

The University of Southern Queensland is a registered provider of education with the Australian Government.
(CRICOS Institution Code QLD 00244B / NSW 02225M, TEQSA PRV12081 )