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:
commit
fb13746644
@ -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) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user