1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-07 07:06:30 +02:00

Fix for Banner insert issue when using PDO. Corrected display of MYSQL error messages when using PDO.

This commit is contained in:
Cameron
2016-05-29 11:00:37 -07:00
parent 00e388490a
commit 638d670183
3 changed files with 13 additions and 14 deletions

View File

@@ -2920,7 +2920,8 @@ class e_admin_model extends e_front_model
$this->_db_errmsg = $sql->getLastErrorText();
$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;
}

View File

@@ -466,6 +466,8 @@ class e_db_mysql
catch(PDOException $ex)
{
$sQryRes = false;
$this->mySQLlastErrText = $ex->getMessage();
$this->mySQLlastErrNum = $ex->getCode();
}
}
else
@@ -477,8 +479,9 @@ class e_db_mysql
}
catch(PDOException $ex)
{
$sQryRes = false;
$this->mySQLlastErrText = $ex->getMessage();
$this->mySQLlastErrNum = $ex->getCode();
}
}
@@ -918,7 +921,7 @@ class e_db_mysql
}
else
{
$this->dbError("db_Insert ({$query})");
// $this->dbError("db_Insert ({$query})");
return FALSE;
}
}
@@ -2522,14 +2525,8 @@ class e_db_mysql
if($this->pdo)
{
// $this->mySQLlastErrNum =;
$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)
{
return null;

View File

@@ -113,7 +113,7 @@ class banner_ui extends e_admin_ui
protected $fields = array (
'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_clientname' => array ( 'title' => 'Clientname', 'type' => 'method', 'tab'=>1, 'data' => 'str', 'width' => 'auto', 'filter' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
@@ -170,7 +170,7 @@ class banner_ui extends e_admin_ui
$new_data['banner_clientname'] = $new_data['banner_clientname_sel'];
}
if(!empty($new_data['banner_campaign_sel']) && $new_data['banner_campaign_sel'] != '_new_')
{
$new_data['banner_campaign'] = $new_data['banner_campaign_sel'];
@@ -187,7 +187,8 @@ class banner_ui extends e_admin_ui
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
{
$text .= $frm->text('client_name',$curVal);
$text .= $frm->text('banner_clientname',$curVal);
$text .= "<span class='field-help'>".BNRLAN_29."</span>";
}