cc-3936: added warning for metadata attributes that are not defined in constants.php

This commit is contained in:
Rudi Grinberg 2012-08-27 14:03:22 -04:00
parent c14af747b0
commit dea764b8fd
2 changed files with 4 additions and 1 deletions

View file

@ -125,6 +125,9 @@ class Application_Model_StoredFile
foreach ($p_md as $mdConst => $mdValue) {
if (defined($mdConst)) {
$dbMd[constant($mdConst)] = $mdValue;
} else {
Logging::info("Warning: using metadata that is not defined.
[$mdConst] => [$mdValue]");
}
}
$this->setDbColMetadata($dbMd);
@ -153,7 +156,6 @@ class Application_Model_StoredFile
if (!array_key_exists('MDATA_KEY_OWNER_ID', $p_md)) {
//$admins = Application_Model_User::getUsers(array('A'));
$admins = Application_Model_User::getUsersOfType('A');
//$admins = array();
if (count($admins) > 0) { // found admin => pick first one
$owner = $admins[0];
}