3519 : mergeauthority and authority edition were not synched

mergeauthority and ModAuthority were working on two separate directories.
So that no authority would ever be merged via cronjob or commandline script
when MergeAuthoritiesOnUpdate is disable

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
This commit is contained in:
Henri-Damien LAURENT 2009-08-11 14:55:49 +02:00 committed by Galen Charlton
parent d5da1cace0
commit 731b82f764

View file

@ -76,9 +76,9 @@ print "Merging\n" unless $noconfirm;
if ($batch) { if ($batch) {
my @authlist; my @authlist;
my $cgidir = C4::Context->intranetdir ."/cgi-bin"; my $cgidir = C4::Context->intranetdir ."/cgi-bin";
unless (opendir(DIR, "$cgidir/localfile/modified_authorities")) { unless (opendir(DIR, "$cgidir/tmp/modified_authorities")) {
$cgidir = C4::Context->intranetdir; $cgidir = C4::Context->intranetdir;
opendir(DIR, "$cgidir/localfile/modified_authorities") || die "can't opendir $cgidir/localfile/modified_authorities: $!"; opendir(DIR, "$cgidir/tmp/modified_authorities") || die "can't opendir $cgidir/tmp/modified_authorities: $!";
} }
while (my $authid = readdir(DIR)) { while (my $authid = readdir(DIR)) {
if ($authid =~ /\.authid$/) { if ($authid =~ /\.authid$/) {
@ -87,7 +87,7 @@ if ($batch) {
my $MARCauth = GetAuthority($authid) ; my $MARCauth = GetAuthority($authid) ;
next unless ($MARCauth); next unless ($MARCauth);
merge($authid,$MARCauth,$authid,$MARCauth) if ($MARCauth); merge($authid,$MARCauth,$authid,$MARCauth) if ($MARCauth);
unlink $cgidir.'/localfile/modified_authorities/'.$authid.'.authid'; unlink $cgidir.'/tmp/modified_authorities/'.$authid.'.authid';
} }
} }
closedir DIR; closedir DIR;