mirror of
https://github.com/e107inc/e107.git
synced 2025-08-11 09:04:38 +02:00
Fix for Banner insert issue when using PDO. Corrected display of MYSQL error messages when using PDO.
This commit is contained in:
@@ -2920,7 +2920,8 @@ class e_admin_model extends e_front_model
|
|||||||
$this->_db_errmsg = $sql->getLastErrorText();
|
$this->_db_errmsg = $sql->getLastErrorText();
|
||||||
|
|
||||||
$this->addMessageError('SQL Insert Error', $session_messages); //TODO - Lan
|
$this->addMessageError('SQL Insert Error', $session_messages); //TODO - Lan
|
||||||
$this->addMessageDebug('SQL Error #'.$this->_db_errno.': '.$sql->getLastErrorText());
|
$this->addMessageDebug('SQL Error #'.$this->_db_errno.': '.$this->_db_errmsg);
|
||||||
|
$this->addMessageDebug('SQL QRY Error '.print_a($sqlQry,true));
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@@ -466,6 +466,8 @@ class e_db_mysql
|
|||||||
catch(PDOException $ex)
|
catch(PDOException $ex)
|
||||||
{
|
{
|
||||||
$sQryRes = false;
|
$sQryRes = false;
|
||||||
|
$this->mySQLlastErrText = $ex->getMessage();
|
||||||
|
$this->mySQLlastErrNum = $ex->getCode();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -477,8 +479,9 @@ class e_db_mysql
|
|||||||
}
|
}
|
||||||
catch(PDOException $ex)
|
catch(PDOException $ex)
|
||||||
{
|
{
|
||||||
|
|
||||||
$sQryRes = false;
|
$sQryRes = false;
|
||||||
|
$this->mySQLlastErrText = $ex->getMessage();
|
||||||
|
$this->mySQLlastErrNum = $ex->getCode();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -918,7 +921,7 @@ class e_db_mysql
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->dbError("db_Insert ({$query})");
|
// $this->dbError("db_Insert ({$query})");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2522,14 +2525,8 @@ class e_db_mysql
|
|||||||
|
|
||||||
if($this->pdo)
|
if($this->pdo)
|
||||||
{
|
{
|
||||||
// $this->mySQLlastErrNum =;
|
|
||||||
$this->mySQLerror = true;
|
$this->mySQLerror = true;
|
||||||
if(is_object($this->mySQLaccess))
|
|
||||||
{
|
|
||||||
$errInfo= $this->mySQLaccess->errorInfo();
|
|
||||||
$this->mySQLlastErrNum = $errInfo[1];
|
|
||||||
$this->mySQLlastErrText = $errInfo[2]; // $ex->getMessage();
|
|
||||||
}
|
|
||||||
if($this->mySQLlastErrNum == 0)
|
if($this->mySQLlastErrNum == 0)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
|
@@ -113,7 +113,7 @@ class banner_ui extends e_admin_ui
|
|||||||
|
|
||||||
protected $fields = array (
|
protected $fields = array (
|
||||||
'checkboxes' => array ( 'title' => '', 'type' => null, 'data' => null, 'width' => '5%', 'thclass' => 'center', 'forced' => '1', 'class' => 'center', 'toggle' => 'e-multiselect', ),
|
'checkboxes' => array ( 'title' => '', 'type' => null, 'data' => null, 'width' => '5%', 'thclass' => 'center', 'forced' => '1', 'class' => 'center', 'toggle' => 'e-multiselect', ),
|
||||||
'banner_id' => array ( 'title' => LAN_ID, 'data' => 'int', 'width' => '2%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
'banner_id' => array ( 'title' => LAN_ID, 'type' => null, 'data' => 'int', 'width' => '2%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
||||||
'banner_campaign' => array ( 'title' => 'Campaign', 'type' => 'method', 'data' => 'str', 'width' => 'auto', 'filter' => true, 'help' => '', 'readParms' => '', 'writeParms' => array( 'tdClassRight'=>'form-inline'), 'class' => 'left', 'thclass' => 'left', ),
|
'banner_campaign' => array ( 'title' => 'Campaign', 'type' => 'method', 'data' => 'str', 'width' => 'auto', 'filter' => true, 'help' => '', 'readParms' => '', 'writeParms' => array( 'tdClassRight'=>'form-inline'), 'class' => 'left', 'thclass' => 'left', ),
|
||||||
|
|
||||||
'banner_clientname' => array ( 'title' => 'Clientname', 'type' => 'method', 'tab'=>1, 'data' => 'str', 'width' => 'auto', 'filter' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
'banner_clientname' => array ( 'title' => 'Clientname', 'type' => 'method', 'tab'=>1, 'data' => 'str', 'width' => 'auto', 'filter' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
||||||
@@ -188,6 +188,7 @@ class banner_ui extends e_admin_ui
|
|||||||
public function onCreateError($new_data, $old_data)
|
public function onCreateError($new_data, $old_data)
|
||||||
{
|
{
|
||||||
// do something
|
// do something
|
||||||
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -446,7 +447,7 @@ class banner_form_ui extends e_admin_form_ui
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
$text .= $frm->text('client_name',$curVal);
|
$text .= $frm->text('banner_clientname',$curVal);
|
||||||
$text .= "<span class='field-help'>".BNRLAN_29."</span>";
|
$text .= "<span class='field-help'>".BNRLAN_29."</span>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user