bug 5579: correctly signal when to reindex bibs

* when item changes
* when new item is added

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Claire Hernandez <claire.hernandez@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
This commit is contained in:
Galen Charlton 2011-03-03 18:29:32 -05:00 committed by Chris Cormack
parent 095f86ee6e
commit 20c1ac5c8d

View file

@ -263,9 +263,9 @@ sub AddItem {
$item->{'itemnumber'} = $itemnumber; $item->{'itemnumber'} = $itemnumber;
# create MARC tag representing item and add to bib # create MARC tag representing item and add to bib
my $new_item_marc = _marc_from_item_hash($item, $frameworkcode, $unlinked_item_subfields); #my $new_item_marc = _marc_from_item_hash($item, $frameworkcode, $unlinked_item_subfields);
_add_item_field_to_biblio($new_item_marc, $item->{'biblionumber'}, $frameworkcode );
#_add_item_field_to_biblio($new_item_marc, $item->{'biblionumber'}, $frameworkcode ); #_add_item_field_to_biblio($new_item_marc, $item->{'biblionumber'}, $frameworkcode );
ModZebra( $item->{biblionumber}, "specialUpdate", "biblioserver", undef, undef );
logaction("CATALOGUING", "ADD", $itemnumber, "item") if C4::Context->preference("CataloguingLog"); logaction("CATALOGUING", "ADD", $itemnumber, "item") if C4::Context->preference("CataloguingLog");
@ -509,6 +509,7 @@ sub ModItem {
# update biblio MARC XML # update biblio MARC XML
my $whole_item = GetItem($itemnumber) or die "FAILED GetItem($itemnumber)"; my $whole_item = GetItem($itemnumber) or die "FAILED GetItem($itemnumber)";
ModZebra( $whole_item->{biblionumber}, "specialUpdate", "biblioserver", undef, undef );
unless (defined $unlinked_item_subfields) { unless (defined $unlinked_item_subfields) {
$unlinked_item_subfields = _parse_unlinked_item_subfields_from_xml($whole_item->{'more_subfields_xml'}); $unlinked_item_subfields = _parse_unlinked_item_subfields_from_xml($whole_item->{'more_subfields_xml'});
@ -2162,7 +2163,6 @@ sub _koha_modify_item {
$error.="ERROR in _koha_modify_item $query".$dbh->errstr; $error.="ERROR in _koha_modify_item $query".$dbh->errstr;
warn $error; warn $error;
} }
ModZebra( $item->{biblionumber}, "specialUpdate", "biblioserver", undef, undef );
return ($item->{'itemnumber'},$error); return ($item->{'itemnumber'},$error);
} }