Changeset 26893 for main


Ignore:
Timestamp:
2013-02-19T14:12:28+13:00 (11 years ago)
Author:
kjdon
Message:

ConvertBinaryFile needs to reset the doc OID after all the processing has been done. This will mean it uses the top level plugin OIDtype settings, rather than the secondary plugin ones.

Location:
main/trunk/greenstone2/perllib/plugins
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/plugins/BasePlugin.pm

    r26536 r26893  
    10201020sub add_OID {
    10211021    my $self = shift (@_); 
    1022     my ($doc_obj) = @_;
    1023 
    1024     # don't add one if there is one already set
    1025     return unless $doc_obj->get_OID() =~ /^NULL$/;
     1022    my ($doc_obj, $force) = @_;
     1023
     1024    # don't add one if there is one already set, unless we are forced to do so
     1025    return unless ($doc_obj->get_OID() =~ /^NULL$/ || $force);
    10261026    $doc_obj->set_OIDtype($self->{'OIDtype'}, $self->{'OIDmetadata'});
    10271027
  • main/trunk/greenstone2/perllib/plugins/ConvertBinaryFile.pm

    r24568 r26893  
    175175    $self->{'convert_to_ext'} = $convert_to_ext;
    176176    }
    177 
    178177}
    179178sub init {
     
    405404    $doc_obj->set_converted_filename($collect_conv_file);
    406405
    407     my $plugin_filename_encoding = $self->{'filename_encoding'};
     406    my $plugin_filename_encoding = $self->{'filename_encoding'};
    408407    my $filename_encoding = $self->deduce_filename_encoding($file,$metadata,$plugin_filename_encoding);
    409408    $self->set_Source_metadata($doc_obj, $filename_full_path, $filename_encoding);
     
    434433    $self->title_fallback($doc_obj,$topsection,$filename_no_path);
    435434
    436     $self->add_OID($doc_obj);
     435    # force a new OID - this will use OIDtype option set for this plugin.
     436    $self->add_OID($doc_obj, 1);
    437437
    438438    return (1, $doc_obj);
Note: See TracChangeset for help on using the changeset viewer.