FIX #23227 Don't retrieve the last insert id during a tag link import

This commit is contained in:
Florent Poinsaut 2022-12-14 18:06:12 +01:00 committed by GitHub
parent 1033991486
commit 51ac803aee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -994,7 +994,9 @@ class ImportCsv extends ModeleImports
if ($sql) {
$resql = $this->db->query($sql);
if ($resql) {
$last_insert_id_array[$tablename] = $this->db->last_insert_id($tablename); // store the last inserted auto_increment id for each table, so that child tables can be inserted with the appropriate id. This must be done just after the INSERT request, else we risk losing the id (because another sql query will be issued somewhere in Dolibarr).
if (!$is_table_category_link) {
$last_insert_id_array[$tablename] = $this->db->last_insert_id($tablename); // store the last inserted auto_increment id for each table, so that child tables can be inserted with the appropriate id. This must be done just after the INSERT request, else we risk losing the id (because another sql query will be issued somewhere in Dolibarr).
}
$insertdone = true;
} else {
//print 'E';

View File

@ -1041,7 +1041,9 @@ class ImportXlsx extends ModeleImports
if ($sql) {
$resql = $this->db->query($sql);
if ($resql) {
$last_insert_id_array[$tablename] = $this->db->last_insert_id($tablename); // store the last inserted auto_increment id for each table, so that child tables can be inserted with the appropriate id. This must be done just after the INSERT request, else we risk losing the id (because another sql query will be issued somewhere in Dolibarr).
if (!$is_table_category_link) {
$last_insert_id_array[$tablename] = $this->db->last_insert_id($tablename); // store the last inserted auto_increment id for each table, so that child tables can be inserted with the appropriate id. This must be done just after the INSERT request, else we risk losing the id (because another sql query will be issued somewhere in Dolibarr).
}
$insertdone = true;
} else {
//print 'E';