Bug 38029

Summary: Fix POD for bulkmarcimport.pl --delete --authorities
Product: Koha Reporter: Magnus Enger <magnus>
Component: Command-line UtilitiesAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: trivial    
Priority: P5 - low CC: robin
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Magnus Enger 2024-09-30 08:39:05 UTC
POD says: 

  =item B<-d, --delete>

  Delete EVERYTHING related to biblio in koha-DB before import. Tables: biblio,
biblioitems, items

What happens if you combine this with --authorities? One interpretation could be that nothing will happen. Another could be that you delete all biblios, even if you are importing authorities. 

The code looks like this: 

if ($delete) {
    if ($biblios) {
        print "Deleting biblios\n";
        $dbh->do("DELETE FROM biblio");
        $dbh->do("ALTER TABLE biblio AUTO_INCREMENT = 1");
        $dbh->do("DELETE FROM biblioitems");
        $dbh->do("ALTER TABLE biblioitems AUTO_INCREMENT = 1");
        $dbh->do("DELETE FROM items");
        $dbh->do("ALTER TABLE items AUTO_INCREMENT = 1");
    } else {
        print "Deleting authorities\n";
        $dbh->do("truncate auth_header");
    }
    $dbh->do("truncate zebraqueue");
}

So it should do the right thing. The POD should say that --delete --authorities will clean out the auth_header table.