Merge pull request #23228 from FlorentPoinsaut/patch-1

FIX #23227 Don't retrieve the last insert id during a tag link import
This commit is contained in:
Laurent Destailleur 2022-12-17 01:28:20 +01:00 committed by GitHub
commit 55e4ab2e23
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';