View | Details | Raw Unified | Return to bug 12720
Collapse All | Expand All

(-)a/misc/migration_tools/bulkmarcimport.pl (-13 / +14 lines)
Lines 121-136 if ((not defined $sourcesubfield) && (not defined $sourcetag)){ Link Here
121
  $sourcesubfield="a";
121
  $sourcesubfield="a";
122
}
122
}
123
123
124
#Disable the syspref cache or else the following UPDATE statements will have no effect
125
C4::Context->disable_syspref_cache();
126
124
127
# save the CataloguingLog and AuthoritiesLog properties : we don't want to log a bulkmarcimport. It will slow the import &
125
# Disable logging for the biblios and authorities import operation. It would unnecesarily
128
# will create problems in the action_logs table, that can't handle more than 1 entry per second per user.
126
# slow the import
129
my $CataloguingLog = C4::Context->preference('CataloguingLog');
130
$dbh->do("UPDATE systempreferences SET value=0 WHERE variable='CataloguingLog'");
131
127
132
my $AuthoritiesLog = C4::Context->preference('AuthoritiesLog');
128
# Disable the syspref cache so we can change logging settings
133
$dbh->do("UPDATE systempreferences SET value=0 WHERE variable='AuthoritiesLog'");
129
C4::Context->disable_syspref_cache();
130
# Save current CataloguingLog and AuthoritiesLog sysprefs values
131
my $CataloguingLog = C4::Context->preference( 'CataloguingLog' );
132
my $AuthoritiesLog = C4::Context->preference( 'AuthoritiesLog' );
133
# Disable logging for both
134
C4::Context->set_preference( 'CataloguingLog', 0 );
135
C4::Context->set_preference( 'AuthoritiesLog', 0 );
134
136
135
if ($fk_off) {
137
if ($fk_off) {
136
	$dbh->do("SET FOREIGN_KEY_CHECKS = 0");
138
	$dbh->do("SET FOREIGN_KEY_CHECKS = 0");
Lines 500-509 if ($fk_off) { Link Here
500
	$dbh->do("SET FOREIGN_KEY_CHECKS = 1");
502
	$dbh->do("SET FOREIGN_KEY_CHECKS = 1");
501
}
503
}
502
504
503
# restore CataloguingLog
505
# Restore CataloguingLog
504
$dbh->do("UPDATE systempreferences SET value=$CataloguingLog WHERE variable='CataloguingLog'");
506
C4::Context->set_preference( 'CataloguingLog', $CataloguingLog );
505
# restore AuthoritiesLog
507
# Restore AuthoritiesLog
506
$dbh->do("UPDATE systempreferences SET value=$AuthoritiesLog WHERE variable='AuthoritiesLog'");
508
C4::Context->set_preference( 'AuthoritiesLog', $AuthoritiesLog );
507
509
508
my $timeneeded = gettimeofday - $starttime;
510
my $timeneeded = gettimeofday - $starttime;
509
print "\n$i MARC records done in $timeneeded seconds\n";
511
print "\n$i MARC records done in $timeneeded seconds\n";
510
- 

Return to bug 12720