putFile with no metadata uses empty template now.
This commit is contained in:
parent
f35e6d9b1a
commit
557aa91bdd
1 changed files with 14 additions and 11 deletions
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
|
|
||||||
Author : $Author: tomas $
|
Author : $Author: tomas $
|
||||||
Version : $Revision: 1.24 $
|
Version : $Revision: 1.25 $
|
||||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/StoredFile.php,v $
|
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/StoredFile.php,v $
|
||||||
|
|
||||||
------------------------------------------------------------------------------*/
|
------------------------------------------------------------------------------*/
|
||||||
|
@ -103,18 +103,21 @@ class StoredFile{
|
||||||
");
|
");
|
||||||
if(PEAR::isError($res)){ $ac->dbc->query("ROLLBACK"); return $res; }
|
if(PEAR::isError($res)){ $ac->dbc->query("ROLLBACK"); return $res; }
|
||||||
// --- metadata insert:
|
// --- metadata insert:
|
||||||
if($metadata != ''){
|
if(is_null($metadata) || $metadata == ''){
|
||||||
if($mdataLoc=='file' && !file_exists($metadata))
|
$metadata = dirname(__FILE__).'/emptyMdata.xml';
|
||||||
{
|
$mdataLoc = 'file';
|
||||||
return PEAR::raiseError("StoredFile::insert: ".
|
}else{
|
||||||
"metadata file not found ($metadata)");
|
|
||||||
}
|
|
||||||
$res = $ac->md->insert($metadata, $mdataLoc, $ftype);
|
|
||||||
if(PEAR::isError($res)){
|
|
||||||
$ac->dbc->query("ROLLBACK"); return $res;
|
|
||||||
}
|
|
||||||
$emptyState = FALSE;
|
$emptyState = FALSE;
|
||||||
}
|
}
|
||||||
|
if($mdataLoc=='file' && !file_exists($metadata))
|
||||||
|
{
|
||||||
|
return PEAR::raiseError("StoredFile::insert: ".
|
||||||
|
"metadata file not found ($metadata)");
|
||||||
|
}
|
||||||
|
$res = $ac->md->insert($metadata, $mdataLoc, $ftype);
|
||||||
|
if(PEAR::isError($res)){
|
||||||
|
$ac->dbc->query("ROLLBACK"); return $res;
|
||||||
|
}
|
||||||
// --- media file insert:
|
// --- media file insert:
|
||||||
if($mediaFileLP != ''){
|
if($mediaFileLP != ''){
|
||||||
if(!file_exists($mediaFileLP))
|
if(!file_exists($mediaFileLP))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue