[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



Hi,

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
e.g.
{ 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.
e.g.
{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 ?

Cheers

Matt


_____________________________________________________________
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 )

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20170428/715d5b46/attachment-0001.html