修复新数据提交错误时的错误处理

This commit is contained in:
wlx 2012-10-16 02:12:32 +00:00
parent 9ff5f24b0e
commit 4d568916f3
1 changed files with 7 additions and 6 deletions

View File

@ -2843,9 +2843,9 @@ class Admin_DataController extends Zend_Controller_Action
$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender();
$data = "";
$data = "";
$id = $this->_request->getParam('id');
try{
$id = $this->_request->getParam('id');
if(empty($id) || !is_numeric($id))
{
$data = array("error"=>"参数错误");
@ -2885,9 +2885,8 @@ class Admin_DataController extends Zend_Controller_Action
$iso=new ISO19115();
@$iso->saveDB($this->db,$row['data']);
//进入评审库
$sql="insert into mdstatus (uuid,status,userid) select uuid,0,? from geonetworkmetadata where id=?";
$this->db->query($sql,array($u_id,$id));
$sql="insert into mdstatus (uuid,status,userid) select uuid,0,? from geonetworkmetadata where id=?";
$this->db->query($sql,array($u_id,$id));
//email to admin
$mail=new WestdcMailer($this->view->config->smtp);
$mail->setFrom($this->view->config->service->email,'西部数据中心服务组');
@ -2911,7 +2910,9 @@ class Admin_DataController extends Zend_Controller_Action
$data = array("commited"=>1,"error"=>'该版本已经成功提交,请等待数据中心进一步处理!');
$this->jsonexit($data);
return true;
}catch(Exception $e) {
}catch(Exception $e) {
$sql="delete from mdstatus where uuid in (select uuid from geonetworkmetadata where id=?)";
$this->db->query($sql,array($id));
$msg = "提交失败,请确认权限后重试";
if($this->debug>0)
{$msg .= $e->getMessage();}