处理在线资源的名称为空的错误

This commit is contained in:
wlx 2014-03-21 01:43:25 +00:00
parent 2225a3e7f6
commit 4a0307c1dd
1 changed files with 8 additions and 2 deletions

View File

@ -209,8 +209,14 @@ class ISO19115
//处理在线资源 //处理在线资源
if ($this->onlineresource) foreach($this->onlineresource as $resource) if ($this->onlineresource) foreach($this->onlineresource as $resource)
{ {
$sql="insert into onlineresource (uuid,linkage,protocol,name,description) values(?,?,?,?,?)"; if ($resource['name'])
$db->query($sql,array($this->uuid,$resource['linkage'],$resource['protocol'],$resource['name'],$resource['description'])); {
$sql="insert into onlineresource (uuid,linkage,protocol,name,description) values(?,?,?,?,?)";
$db->query($sql,array($this->uuid,$resource['linkage'],$resource['protocol'],$resource['name'],$resource['description']));
} else {
$sql="insert into onlineresource (uuid,linkage,protocol,description) values(?,?,?,?)";
$db->query($sql,array($this->uuid,$resource['linkage'],$resource['protocol'],$resource['description']));
}
} }
//处理缩略图 //处理缩略图
if (!empty($this->thumbnail)) { if (!empty($this->thumbnail)) {