Merge pull request #18019 from ATM-Consulting/NEW_develop_addFileIntoDatabaseIndex_facilitate_setting_description_and_keyword

NEW: make it easier to set the `keyword`, `keywords` and `description` attributes of an ecm file object
This commit is contained in:
Laurent Destailleur 2021-07-11 20:15:29 +02:00 committed by GitHub
commit fb13746644
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1789,7 +1789,14 @@ 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;
} else {
dol_syslog('Error: object ' . get_class($object) . ' has no table_element attribute.');
return -1;
}
if (isset($object->src_object_keywords)) $ecmfile->keywords = $object->src_object_keywords;
}
if ($setsharekey) {