Merge pull request #36671 from frederic34/patch-8

fix missing import_key fetch in categories class
This commit is contained in:
Laurent Destailleur 2025-12-16 14:24:55 +01:00 committed by GitHub
commit d0dd4cdd57
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -431,7 +431,7 @@ class Categorie extends CommonObject
'cat_fk' => (empty($this->MAP_CAT_FK[$mapCode]) ? $mapCode : $this->MAP_CAT_FK[$mapCode]),
'cat_table' => (empty($this->MAP_CAT_TABLE[$mapCode]) ? $mapCode : $this->MAP_CAT_TABLE[$mapCode]),
'obj_class' => (empty($this->MAP_OBJ_CLASS[$mapCode]) ? $mapCode : $this->MAP_OBJ_CLASS[$mapCode]),
'obj_table' => (empty($this->MAP_OBJ_TABLE[$mapCode]) ? $mapCode : $this->MAP_OBJ_TABLE[$mapCode])
'obj_table' => (empty($this->MAP_OBJ_TABLE[$mapCode]) ? $mapCode : $this->MAP_OBJ_TABLE[$mapCode]),
);
}
@ -469,7 +469,7 @@ class Categorie extends CommonObject
}
$sql = "SELECT rowid, fk_parent, entity, label, description, color, position, fk_soc, visible, type, ref_ext";
$sql .= ", date_creation, tms, fk_user_creat, fk_user_modif";
$sql .= ", date_creation, tms, fk_user_creat, fk_user_modif, import_key";
$sql .= " FROM ".MAIN_DB_PREFIX."categorie";
if ($id) {
$sql .= " WHERE rowid = ".((int) $id);
@ -502,8 +502,9 @@ class Categorie extends CommonObject
$this->date_modification = $this->db->jdate($res['tms']);
$this->user_creation_id = (int) $res['fk_user_creat'];
$this->user_modification_id = (int) $res['fk_user_modif'];
$this->import_key = $res['import_key'];
// Retrieve all extrafield
// Retrieve all extrafields
// fetch optionals attributes and labels
$this->fetch_optionals();