[Koha] Using build_oai_sets.pl with embed items option

Pedro Amorim pjamorim91 at gmail.com
Sat Apr 23 02:46:32 NZST 2016


Hello Mirko,

Yes, I have basic knowledge in git, however I have never contributed to an
open-source project before.
My question was more about on how to file a bug, but I think I got it
sorted:
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16327

So I have to:
1) Clone the project branch 3.22;
2) Alter the code;
3) Submit the patch using git format-patch
4) Attach the diff in the bug tracker

Is that it?

Thank you,

Pedro Amorim


2016-04-21 19:48 GMT+00:00 Mirko Tietgen <mirko at abunchofthings.net>:

> Hi Pedro,
>
> there are different ways of setting up a dev environment. The
> easiest setup these days is said to be Kohadevbox.[1]
>
> A more manual setup info can be found in the wiki.[2]
>
> Have you used git before? If you are new to git don't be afraid,
> it's less complicated than it looks. You could drop by on IRC to get
> some help with the setup. There is someone around most of the time.
>
> HTH,
>
> Mirko
>
> [1] https://github.com/digibib/kohadevbox
> [2] https://wiki.koha-community.org/wiki/Version_Control_Using_Git
> [3] https://koha-community.org/get-involved/irc/
>
>
>
>
> Pedro Amorim schrieb am 21.04.2016
> > Hello Mirko,
> >
> > I have never done that before, would you please provide some information
> on how
> > to do it?
> >
> > Thanks,
> >
> > Pedro Amorim
> >
> > 2016-04-21 18:30 GMT+00:00 Mirko Tietgen <mirko at abunchofthings.net
> > <mailto:mirko at abunchofthings.net>>:
> >
> >     Hi Pedro,
> >
> >     it would be fantastic if you could file a bug report[1] and add a
> >     patch with your changes, so we can test it and you are credited for
> it.
> >
> >     Cheers,
> >
> >     Mirko
> >
> >     [1] https://bugs.koha-community.org/bugzilla3/
> >
> >
> >
> >     Pedro Amorim schrieb am 21.04.2016
> >     > By the way, using Koha 3.22 from debian packages.
> >     >
> >     > The problem was in CalcOAISetsBiblio function.
> >     > I managed to solve the problem by changing the foreach in file
> >     > /usr/share/koha/lib/C4/OAI/Sets.pm:494 to:
> >     >
> >     > foreach my $set_id (keys %$oai_sets_mappings) {
> >     >         foreach my $mapping (@{ $oai_sets_mappings->{$set_id} }) {
> >     >             next if not $mapping;
> >     >             my $field = $mapping->{'marcfield'};
> >     >             my $subfield = $mapping->{'marcsubfield'};
> >     >             my $operator = $mapping->{'operator'};
> >     >             my $value = $mapping->{'marcvalue'};
> >     >             #my @subfield_values = $record->subfield($field,
> $subfield);
> >     >             my @field_values = $record->field($field);
> >     >             foreach my $field_value (@field_values){
> >     >             my @subfield_values =
> $field_value->subfield($subfield);
> >     >    if ($operator eq 'notequal') {
> >     >                 if(0 == grep /^$value$/, @subfield_values) {
> >     >                     push @biblio_sets, $set_id;
> >     >                     last;
> >     >                 }
> >     >             }
> >     >             else {
> >     >                 if(0 < grep /^$value$/, @subfield_values) {
> >     >                     push @biblio_sets, $set_id;
> >     >                     last;
> >     >                 }
> >     >             }
> >     >             }
> >     >         }
> >     >     }
> >     >
> >      > The original code was only extracting the *first* item for each
> biblio,
> >     > hence why I was only getting 27 records indexed instead of an
> expected
> >     > 1141. Those 27 records only had 1 item for each record, in the
> wanted
> >     > library. All others have items from several libraries, including
> the one I
> >     > wanted.
> >     >
> >     > Hopefully someone will confirm this was a bug and it's solved by
> the code
> >     > above.
> >     >
> >     > Thanks,
> >     >
> >     > Pedro Amorim
> >     >
> >     >
> >     >
> >     >
> >     >
> >     > 2016-04-21 15:09 GMT+00:00 Pedro Amorim <pjamorim91 at gmail.com
> <mailto:pjamorim91 at gmail.com>>:
> >     >
> >     >> Hello all,
> >     >>
> >     >> I've configured an OAI set mapping with the field 995$a equals
> "libcode",
> >     >> where 995$a holds the aquisition library code for the item.
> >     >>
> >     >> As this is an item field, not a biblio field, I have to run
> >     >>build_oai_sets.pl <http://build_oai_sets.pl> with '-i' option in
> order to
> >     embed items to the records.
> >     >>
> >     >> This is working fine, however, it's only indexing records which
> only have
> >     >> 1 item of 'libcode'.
> >     >> Every other biblio with, say, 5 items from different libraries
> and 1 from
> >     >> 'libcode' library are not indexing.
> >     >>
> >     >> I think the C4::Biblio::EmbedItemsInMarcBiblio function might be
> only
> >     >> considering the first item in a biblio, instead of checking all
> of them.
> >     >>
> >     >> Has anyone else come across this situation?
> >     >>
> >     >> Thanks,
> >     >>
> >     >> Pedro Amorim
> >     >>
>
>
>
> _______________________________________________
> Koha mailing list  http://koha-community.org
> Koha at lists.katipo.co.nz
> https://lists.katipo.co.nz/mailman/listinfo/koha
>
>


More information about the Koha mailing list