Fix for bug #2098 - warnings in Web interface
This commit is contained in:
parent
5b4f673c04
commit
3239208c60
|
@ -233,11 +233,13 @@ class uiBase
|
||||||
} else {
|
} else {
|
||||||
$this->id = M2tree::GetObjId($this->login, $this->gb->storId);
|
$this->id = M2tree::GetObjId($this->login, $this->gb->storId);
|
||||||
}
|
}
|
||||||
$parentId = M2tree::GetParent($this->id);
|
if (!is_null($this->id)) {
|
||||||
$this->pid = ($parentId != 1) ? $parentId : FALSE;
|
$parentId = M2tree::GetParent($this->id);
|
||||||
$this->type = Greenbox::getFileType($this->id);
|
$this->pid = ($parentId != 1) ? $parentId : FALSE;
|
||||||
$this->fid = ($this->type == 'Folder') ? $this->id : $this->pid;
|
$this->type = Greenbox::getFileType($this->id);
|
||||||
$this->homeid = M2tree::GetObjId($this->login, $this->gb->storId);
|
$this->fid = ($this->type == 'Folder') ? $this->id : $this->pid;
|
||||||
|
$this->homeid = M2tree::GetObjId($this->login, $this->gb->storId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,19 +81,18 @@ class BasicStor {
|
||||||
* @param string $mdataLoc
|
* @param string $mdataLoc
|
||||||
* 'file'|'string'
|
* 'file'|'string'
|
||||||
* @return int
|
* @return int
|
||||||
* @exception PEAR::error
|
* @exception PEAR_Error
|
||||||
*/
|
*/
|
||||||
public function bsPutFile($parid, $fileName, $mediaFileLP, $mdataFileLP,
|
public function bsPutFile($parid, $fileName, $mediaFileLP, $mdataFileLP,
|
||||||
$gunid=NULL, $ftype='unKnown', $mdataLoc='file')
|
$gunid=NULL, $ftype='unknown', $mdataLoc='file')
|
||||||
{
|
{
|
||||||
$ftype = strtolower($ftype);
|
$ftype = strtolower($ftype);
|
||||||
$id = BasicStor::AddObj($fileName, $ftype, $parid);
|
$id = BasicStor::AddObj($fileName, $ftype, $parid);
|
||||||
if (PEAR::isError($id)) {
|
if (PEAR::isError($id)) {
|
||||||
return $id;
|
return $id;
|
||||||
}
|
}
|
||||||
$ac = StoredFile::insert(
|
$ac = StoredFile::insert($this, $id, $fileName,
|
||||||
$this, $id, $fileName, $mediaFileLP, $mdataFileLP, $mdataLoc,
|
$mediaFileLP, $mdataFileLP, $mdataLoc, $gunid, $ftype);
|
||||||
$gunid, $ftype);
|
|
||||||
if (PEAR::isError($ac)) {
|
if (PEAR::isError($ac)) {
|
||||||
$res = $this->removeObj($id);
|
$res = $this->removeObj($id);
|
||||||
// catch constraint violations
|
// catch constraint violations
|
||||||
|
@ -1586,7 +1585,7 @@ class BasicStor {
|
||||||
public static function GetObjType($oid)
|
public static function GetObjType($oid)
|
||||||
{
|
{
|
||||||
$type = M2tree::GetObjType($oid);
|
$type = M2tree::GetObjType($oid);
|
||||||
if ($type == 'File') {
|
if ( !PEAR::isError($type) && ($type == 'File') ) {
|
||||||
$gunid = BasicStor::GunidFromId($oid);
|
$gunid = BasicStor::GunidFromId($oid);
|
||||||
if (PEAR::isError($gunid)) {
|
if (PEAR::isError($gunid)) {
|
||||||
return $gunid;
|
return $gunid;
|
||||||
|
|
Loading…
Reference in New Issue