cc-3936: Fixed bug where setDbColMetadata to use airtime metadata key names.
This commit is contained in:
parent
589477c8fe
commit
8d7f3817ec
1 changed files with 10 additions and 2 deletions
|
@ -155,7 +155,7 @@ class Application_Model_StoredFile
|
||||||
if(!$owner) { // no owner detected, we try to assign one.
|
if(!$owner) { // no owner detected, we try to assign one.
|
||||||
// if MDATA_OWNER_ID is not set then we default to the
|
// if MDATA_OWNER_ID is not set then we default to the
|
||||||
// first admin user we find
|
// first admin user we find
|
||||||
if (!array_key_exists('MDATA_KEY_OWNER_ID', $p_md)) {
|
if (!array_key_exists('owner_id', $p_md)) {
|
||||||
//$admins = Application_Model_User::getUsers(array('A'));
|
//$admins = Application_Model_User::getUsers(array('A'));
|
||||||
$admins = Application_Model_User::getUsersOfType('A');
|
$admins = Application_Model_User::getUsersOfType('A');
|
||||||
if (count($admins) > 0) { // found admin => pick first one
|
if (count($admins) > 0) { // found admin => pick first one
|
||||||
|
@ -165,7 +165,7 @@ class Application_Model_StoredFile
|
||||||
// get the user by id and set it like that
|
// get the user by id and set it like that
|
||||||
else {
|
else {
|
||||||
$user = CcSubjsQuery::create()
|
$user = CcSubjsQuery::create()
|
||||||
->findPk($p_md['MDATA_OWNER_ID']);
|
->findPk($p_md['owner_id']);
|
||||||
if ($user) {
|
if ($user) {
|
||||||
$owner = $user;
|
$owner = $user;
|
||||||
}
|
}
|
||||||
|
@ -178,6 +178,12 @@ class Application_Model_StoredFile
|
||||||
'".$p_md['MDATA_KEY_FILEPATH']."'");
|
'".$p_md['MDATA_KEY_FILEPATH']."'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
# We don't want to process owner_id in bulk because we already
|
||||||
|
# processed it in the code above. This is done because owner_id
|
||||||
|
# needs special handling
|
||||||
|
if (array_key_exists('owner_id', $p_md)) {
|
||||||
|
unset($p_md['owner_id']);
|
||||||
|
}
|
||||||
foreach ($p_md as $dbColumn => $mdValue) {
|
foreach ($p_md as $dbColumn => $mdValue) {
|
||||||
// don't blank out name, defaults to original filename on first
|
// don't blank out name, defaults to original filename on first
|
||||||
// insertion to database.
|
// insertion to database.
|
||||||
|
@ -797,6 +803,8 @@ class Application_Model_StoredFile
|
||||||
$chunk = isset($_REQUEST["chunk"]) ? $_REQUEST["chunk"] : 0;
|
$chunk = isset($_REQUEST["chunk"]) ? $_REQUEST["chunk"] : 0;
|
||||||
$chunks = isset($_REQUEST["chunks"]) ? $_REQUEST["chunks"] : 0;
|
$chunks = isset($_REQUEST["chunks"]) ? $_REQUEST["chunks"] : 0;
|
||||||
$fileName = isset($_REQUEST["name"]) ? $_REQUEST["name"] : '';
|
$fileName = isset($_REQUEST["name"]) ? $_REQUEST["name"] : '';
|
||||||
|
# TODO : should not log __FILE__ itself. there is general logging for
|
||||||
|
# this
|
||||||
Logging::info(__FILE__.":uploadFile(): filename=$fileName to $p_targetDir");
|
Logging::info(__FILE__.":uploadFile(): filename=$fileName to $p_targetDir");
|
||||||
// Clean the fileName for security reasons
|
// Clean the fileName for security reasons
|
||||||
//this needs fixing for songs not in ascii.
|
//this needs fixing for songs not in ascii.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue