Another fix for bug #2114 - after command line import, a file could not be added to the live mode. There were two problems: an incorrect API call, and the new feature which only makes symlinks to files (to fix the double-disk space problem) caused problems because files_exists() didnt work anymore.

This commit is contained in:
paul 2007-01-12 06:11:35 +00:00
parent 36b6fa83e0
commit a11d39d8f6
1 changed files with 4 additions and 3 deletions

View File

@ -93,8 +93,9 @@ class BasicStor {
if (PEAR::isError($id)) {
return $id;
}
$storedFile = StoredFile::insert($id, $fileName,
$localFilePath, $metadataFilePath, $mdataLoc, $gunid, $ftype, 'StoredFile', $copyMedia);
$storedFile = StoredFile::Insert($id, $fileName,
$localFilePath, $metadataFilePath, $mdataLoc, $gunid, $ftype,
$copyMedia);
if (PEAR::isError($storedFile)) {
$res = BasicStor::RemoveObj($id);
// catch constraint violations
@ -380,7 +381,7 @@ class BasicStor {
$token = StoredFile::CreateGunid();
if (!is_null($realFname)) {
$linkFname = $CC_CONFIG['accessDir']."/$token.$ext";
if (!file_exists($realFname)) {
if (!is_file($realFname) && !is_link($realFname)) {
return PEAR::raiseError(
"BasicStor::bsAccess: real file not found ($realFname)",
GBERR_FILEIO);