diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 7e34eec5ecd..8e44e30f445 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1789,7 +1789,9 @@ function addFileIntoDatabaseIndex($dir, $file, $fullpathorig = '', $mode = 'uplo if (is_object($object) && $object->id > 0) { $ecmfile->src_object_id = $object->id; - $ecmfile->src_object_type = $object->table_element; + if (isset($object->table_element)) $ecmfile->src_object_type = $object->table_element; + if (isset($object->src_object_description)) $ecmfile->description = $object->src_object_description; + if (isset($object->src_object_keyword)) $ecmfile->keyword = $object->src_object_keyword; } if ($setsharekey) { diff --git a/htdocs/ecm/class/ecmfiles.class.php b/htdocs/ecm/class/ecmfiles.class.php index 035a7aee9c6..df18aa13d2f 100644 --- a/htdocs/ecm/class/ecmfiles.class.php +++ b/htdocs/ecm/class/ecmfiles.class.php @@ -288,6 +288,7 @@ class EcmFiles extends CommonObject $sql .= 'fullpath_orig,'; $sql .= 'description,'; $sql .= 'keywords,'; + $sql .= 'keyword,'; $sql .= 'cover,'; $sql .= 'position,'; $sql .= 'gen_or_uploaded,'; @@ -309,6 +310,7 @@ class EcmFiles extends CommonObject $sql .= ' '.(!isset($this->fullpath_orig) ? 'NULL' : "'".$this->db->escape($this->fullpath_orig)."'").','; $sql .= ' '.(!isset($this->description) ? 'NULL' : "'".$this->db->escape($this->description)."'").','; $sql .= ' '.(!isset($this->keywords) ? 'NULL' : "'".$this->db->escape($this->keywords)."'").','; + $sql .= ' '.(!isset($this->keyword) ? 'NULL' : "'".$this->db->escape($this->keyword)."'").','; $sql .= ' '.(!isset($this->cover) ? 'NULL' : "'".$this->db->escape($this->cover)."'").','; $sql .= ' '.$maxposition.','; $sql .= ' '.(!isset($this->gen_or_uploaded) ? 'NULL' : "'".$this->db->escape($this->gen_or_uploaded)."'").',';