http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7671
--- Comment #23 from Paul Poulain <paul.poul...@biblibre.com> --- QA comment: This part of the code is wrong: + my $sthr = $dbh->prepare("SELECT max(accountlines_id) AS lastinsertid FROM accountlines"); + $sthr->execute(); + my $datalastinsertid = $sthr->fetchrow_hashref; + $sthr->finish; + return $datalastinsertid->{'lastinsertid'}; => in case 2 lines are added by 2 librarians almost at the same time, you may get a wrong lastinsertid + this add an unneeded SQL query. Please use $rv = $dbh->last_insert_id($catalog, $schema, $table, $field); instead Also note that your updatedatabase misses a } (it does not compile): $dbh->do("UPDATE systempreferences SET value = 'call_number' WHERE variable = 'OPACdefaultSortField' AND value = 'callnumber'"); print "Upgrade to $DBversion done (Bug 8657 - Default sort by call number does not work. Correcting system preference value.)\n"; SetVersion ($DBversion); + <<<<< SHOULD BE A } HERE + +$DBversion = "XXX"; +if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { + $dbh->do("ALTER TABLE `accountlines` ADD `accountlines_id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;"); -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list Koha-bugs@lists.koha-community.org http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/