There appears to be a bug in Koha 2.0.0pre4 (and pre5) when handling multiple subjects. The code is designed to handle multiple subjects per biblio (hence the use of an entirely seperate table) but there is a small bug in the code which prevents all but the last subject from being added to the bibliosubject table. Well actually, to be more accurate all the subjects are added, but all but the last are subsequently deleted. Anyways, instead of going on and on about it, why don't I just give you the simple patch! Thanks for all the hard work Koha developers. *** Biblio.pm.bak 2003-11-17 21:45:33.000000000 -0800 --- Biblio.pm 2003-11-17 22:28:56.000000000 -0800 *************** *** 1261,1272 **** ($tagfield,$tagsubfield) = MARCfind_marc_from_kohafield($dbh,"bibliosubject.subject"); my @subj = $record->field($tagfield); foreach my $subject (@subj) { my @subjsubfield = $subject->subfield($tagsubfield); - my @subjects; foreach my $subfieldcount (0..$#subjsubfield) { push @subjects,$subjsubfield[$subfieldcount]; } - OLDmodsubject($dbh,$oldbibnum,1,@subjects); } # we must add bibnum and bibitemnum in MARC::Record... # we build the new field with biblionumber and biblioitemnumber --- 1261,1272 ---- ($tagfield,$tagsubfield) = MARCfind_marc_from_kohafield($dbh,"bibliosubject.subject"); my @subj = $record->field($tagfield); + my @subjects; foreach my $subject (@subj) { my @subjsubfield = $subject->subfield($tagsubfield); foreach my $subfieldcount (0..$#subjsubfield) { push @subjects,$subjsubfield[$subfieldcount]; } } + OLDmodsubject($dbh,$oldbibnum,1,@subjects); # we must add bibnum and bibitemnum in MARC::Record... # we build the new field with biblionumber and biblioitemnumber *************** *** 1321,1332 **** ($tagfield,$tagsubfield) = MARCfind_marc_from_kohafield($dbh,"bibliosubject.subject"); my @subj = $record->field($tagfield); foreach my $subject (@subj) { my @subjsubfield = $subject->subfield($tagsubfield); - my @subjects; foreach my $subfieldcount (0..$#subjsubfield) { push @subjects,$subjsubfield[$subfieldcount]; } - OLDmodsubject($dbh,$oldbiblionumber,1,@subjects); } return 1; } --- 1321,1332 ---- ($tagfield,$tagsubfield) = MARCfind_marc_from_kohafield($dbh,"bibliosubject.subject"); my @subj = $record->field($tagfield); + my @subjects; foreach my $subject (@subj) { my @subjsubfield = $subject->subfield($tagsubfield); foreach my $subfieldcount (0..$#subjsubfield) { push @subjects,$subjsubfield[$subfieldcount]; } } + OLDmodsubject($dbh,$oldbiblionumber,1,@subjects); return 1; }
On 2003-11-18 06:37:37 +0000 Chris Michalak <michalak@mech.ubc.ca> wrote:
there is a small bug in the code which prevents all but the last subject from being added to the bibliosubject table.
This is bug 380 on bugs.koha.org and there exists a patch there for it (and a couple of other minor errors). I'm sure this fix will be in the next release. Thanks for your work, anyhow. -- MJR/slef My Opinion Only and possibly not of any group I know. Please http://remember.to/edit_messages on lists to be sure I read http://mjr.towers.org.uk/ gopher://g.towers.org.uk/ slef@jabber.at Creative copyleft computing services via http://www.ttllp.co.uk/
participants (2)
-
Chris Michalak -
MJ Ray