add more error control when submit new metadata
This commit is contained in:
parent
be8b6ef2b5
commit
a2745777c2
|
@ -442,8 +442,8 @@ class HeiheController extends DataController
|
|||
$this->_helper->viewRenderer->setNoRender();
|
||||
|
||||
$data = "";
|
||||
$id = $this->_request->getParam('id');
|
||||
try{
|
||||
$id = $this->_request->getParam('id');
|
||||
if(empty($id) || !is_numeric($id))
|
||||
{
|
||||
$data = array("error"=>"参数错误");
|
||||
|
@ -609,6 +609,11 @@ class HeiheController extends DataController
|
|||
$this->jsonexit($data);
|
||||
return true;
|
||||
}catch(Exception $e) {
|
||||
$sql="delete from mdstatus where uuid in (select uuid from geonetworkmetadata where id=?)";
|
||||
$this->db->query($sql,array($id));
|
||||
$sql="delete from mdauthor where userid=? and uuid in (select uuid from geonetworkmetadata where id=?)";
|
||||
$this->db->query($sql,array($u_id,$id));
|
||||
|
||||
$msg = "提交失败,请确认权限后重试";
|
||||
if($this->debug>0)
|
||||
{$msg .= $e->getMessage();}
|
||||
|
|
Loading…
Reference in New Issue