Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Viva
Estava quase terminando o meu site (usando o Toolbox) quando sem nada parecer começa a aparecer este erro. Já procurei em todo o lado e parece que tem a ver com incompatibilidades com o PHP 5.3. Alguém teve o mesmo problema? Resolveu?
Provavelmente você está chamando uma função/método da maneira errada.
>
Poste os códigos.
Aqui estão:
O erro refere-se a um ficheiro que está na pasta includes/tng/tNG_insert.class.php na linha 30:
*function tNG_insert(&$connection) {*
(esta é a linha 30)**parent::tNG_fields($connection);**
$this->transactionType = '_insert';
$this->exportRecordset = true;
$this->registerTrigger("ERROR", "Trigger_Default_Insert_RollBack", 99);
}
Chega este código ou posto o código de todo o ficheiro?
Fico a aguardar uma resposta, obrigado pela ajuda.
Cara pode ser diversas coisas...
Confira se dentro do seu arquivo se o nome desse método está correto
caso esteja pode ser problema no seu local host
ai recomendo tentar com a ultima versão do wamp
>
Cara pode ser diversas coisas...
Confira se dentro do seu arquivo se o nome desse método está correto
caso esteja pode ser problema no seu local host
ai recomendo tentar com a ultima versão do wamp
Está tudo correcto.
wamp...não posso pois o site está alojado numa empresa e eles não querem passar para a anterior versão do PHP que estava funcionado bem.
Cara é meio complicado por que acredito que o erro não esteja no DreamWeaver
Poste o código completo que eu irei mover para área de PHP caso o pessoal veja que o código está correto
ai vemos o que pode ser no DW
Mas cheguei a fazer algumas pesquisas no google e não encontrei nada sobre relacionado a programa.
>
Cara é meio complicado por que acredito que o erro não esteja no DreamWeaver
Poste o código completo que eu irei mover para área de PHP caso o pessoal veja que o código está correto
ai vemos o que pode ser no DW
Mas cheguei a fazer algumas pesquisas no google e não encontrei nada sobre relacionado a programa.
Ok Thelon aqui vai, espero que não fique muito confuso:
Qualquer das minhas páginas dáo mesmo erro, po isso coloco aqui o código de uma que é a do LOGIN.
<?php require_once('Connections/agrupamento.php'); ?>
<?php
// Load the common classes
require_once('includes/common/KT_common.php');
// Load the tNG classes
require_once('includes/tng/tNG.inc.php');
// Make a transaction dispatcher instance
$tNGs = new tNG_dispatcher("");
// Make unified connection variable
$conn_agrupamento = new KT_connection($agrupamento, $database_agrupamento);
// Start trigger
$formValidation = new tNG_FormValidation();
$formValidation->addField("kt_login_user", true, "text", "", "", "", "");
$formValidation->addField("kt_login_password", true, "text", "", "", "", "");
$tNGs->prepareValidation($formValidation);// Make a login transaction instance
$loginTransaction = new tNG_login($conn_agrupamento);
$tNGs->addTransaction($loginTransaction);$loginTransaction->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "kt_login1");
$loginTransaction->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $formValidation);
$loginTransaction->registerTrigger("END", "Trigger_Default_Redirect", 99, "{kt_login_redirect}");$loginTransaction->addColumn("kt_login_user", "STRING_TYPE", "POST", "kt_login_user");
$loginTransaction->addColumn("kt_login_password", "STRING_TYPE", "POST", "kt_login_password");// Execute all the registered transactions
$tNGs->executeTransactions();
// Get the transaction recordset
$rscustom = $tNGs->getRecordset("custom");
$row_rscustom = mysql_fetch_assoc($rscustom);
$totalRows_rscustom = mysql_num_rows($rscustom);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">](http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd)
<html xmlns="[http://www.w3.org/1999/xhtml">](http://www.w3.org/1999/xhtml)
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<link href="includes/skins/mxkollection3.css" rel="stylesheet" type="text/css" media="all" />
<script src="includes/common/js/base.js" type="text/javascript"></script>
<script src="includes/common/js/utility.js" type="text/javascript"></script>
<script src="includes/skins/style.js" type="text/javascript"></script>
<?php echo $tNGs->displayValidationRules();?>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<link href="css/text.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table width="80%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td class="titulos">Área restrita</td>
</tr>
<tr>
<td>
<p class="subdued">Este espaço é exclusivo.<br />
Para aceder ao mesmo preencha os campos: </p>
<p>
<?php
echo $tNGs->getLoginMsg();
?>
<?php
echo $tNGs->getErrorMsg();
?>
</p>
<form method="post" id="form1" class="KT_tngformerror" action="<?php echo KT_escapeAttribute(KT_getFullUri()); ?>">
<table width="80%" align="center" cellpadding="2" cellspacing="0" class="KT_tngtable">
<tr>
<td class="KT_th"><label for="kt_login_user">Username (E-mail de registo):</label></td>
<td><input type="text" name="kt_login_user" id="kt_login_user" value="<?php echo KT_escapeAttribute($row_rscustom['kt_login_user']); ?>" size="32" />
<?php echo $tNGs->displayFieldHint("kt_login_user");?> <?php echo $tNGs->displayFieldError("custom", "kt_login_user"); ?> </td>
</tr>
<tr>
<td class="KT_th"><label for="kt_login_password">Password:</label></td>
<td><input type="password" name="kt_login_password" id="kt_login_password" value="" size="32" />
<?php echo $tNGs->displayFieldHint("kt_login_password");?> <?php echo $tNGs->displayFieldError("custom", "kt_login_password"); ?> </td>
</tr>
<tr class="KT_buttons">
<td colspan="2"><input type="submit" name="kt_login1" id="kt_login1" value="Login" /> </td>
</tr>
</table>
</form>
<p> </p></td>
</tr>
</table>
</body>
</html>
Agora o ficheiro (tNG_insert.class.php) para onde apontava erro na linha 30 (coloquei a BOLD):
<?php
/*
* ADOBE SYSTEMS INCORPORATED
* Copyright 2007 Adobe Systems Incorporated
* All Rights Reserved
*
* NOTICE: Adobe permits you to use, modify, and distribute this file in accordance with the
* terms of the Adobe license agreement accompanying it. If you have received this file from a
* source other than Adobe, then your use, modification, or distribution of it requires the prior
* written permission of Adobe.
*/
/*
Copyright (c) InterAKT Online 2000-2006. All rights reserved.
*/
/**
* This class is the "insert" implementation of the tNG_fields class.
* @access public
*/
class tNG_insert extends tNG_fields {
/**
* Constructor. Sets the connection, the database name and other default values.
* Also sets the transaction type.
* @param object KT_Connection &$connection the connection object
* @access public
*/
function tNG_insert(&$connection) {
[b]parent::tNG_fields($connection);[/b]
$this->transactionType = '_insert';
$this->exportRecordset = true;
$this->registerTrigger("ERROR", "Trigger_Default_Insert_RollBack", 99);
}
/**
* Overwrites tNG method in order to register some triggers specific to Register Transaction
* @access protected
*/
function doTransaction() {
$table = $this->getTable();
if (isset($GLOBALS['tNG_login_config']['table']) && $GLOBALS['tNG_login_config']['table'] == $table ) {
// BEFORE triggers
$this->registerTrigger("BEFORE", "Trigger_Registration_CheckUniqueUsername", 200);
$this->registerTrigger("BEFORE", "Trigger_Registration_CheckPassword", 210);
if ($GLOBALS['tNG_login_config']['password_encrypt'] == "true") {
$this->registerTrigger("BEFORE", "Trigger_Registration_EncryptPassword", 220);
}
if ($GLOBALS['tNG_login_config']['activation_field'] != "" ) {
$this->registerTrigger("BEFORE", "Trigger_Registration_PrepareActivation", 230);
}
if ((isset($GLOBALS['tNG_login_config']['registration_date_field']) && $GLOBALS['tNG_login_config']['registration_date_field']!='') || (isset($GLOBALS['tNG_login_config']['max_tries_field']) && $GLOBALS['tNG_login_config']['max_tries_field']!='') || (isset($GLOBALS['tNG_login_config']['max_tries_disabledate_field']) && $GLOBALS['tNG_login_config']['max_tries_disabledate_field']!='')) {
$this->registerTrigger("BEFORE", "Trigger_Registration_PrepareRegExtrFields", 240);
}
// AFTER triggers
if ($GLOBALS['tNG_login_config']['password_encrypt'] == "true") {
$this->registerTrigger("AFTER", "Trigger_Registration_RestorePassword", -10);
}
$this->registerTrigger("AFTER", "Trigger_Registration_AddDynamicFields", -5);
}
parent::doTransaction();
}
/**
* Prepares the insert SQL query to be executed
* @access protected
*/
function prepareSQL() {
tNG_log::log('tNG_insert', 'prepareSQL', 'begin');
parent::prepareSQL();
// check the columns number
$sql = 'INSERT INTO ' . $this->table;
$tmColStr = $tmValStr = '';
$KT_sp = false;
//generate the column and the value strings
foreach($this->columns as $colName => $colDetail) {
$colType = $colDetail['type'];
$colValue = $colDetail['value'];
$colMethod = $colDetail['method'];
if ($colMethod != 'HIDDEN') {
// if we handle a hidden field, we should not use it in the update SQL.
$sep = ($KT_sp) ? ', ' : '';// set the separator ',' (first time will be none)
$KT_sp = true;
//build the nameList and valueList
$tmColStr = $tmColStr . $sep . KT_escapeFieldName($colName);
if ($colType == "FILE_TYPE") {
// if we handle a file upload, the file name will be set afterwards.
$tmValStr = $tmValStr . $sep . "''";
} else {
$tmValStr = $tmValStr . $sep . KT_escapeForSql($colValue, $colType);
}
}
}
if (!$KT_sp) {
// no column was actually added
die('tNG_insert.prepareSQL:<br />Please specify some fields to insert.');
}
// build the final SQL
$sql .= ' (' . $tmColStr . ') values (' . $tmValStr . ')';
$this->setSQL($sql);
tNG_log::log('tNG_insert', 'prepareSQL', 'end');
return null;
}
/**
* Get the local recordset associated to this transaction
* @return object resource Recordset resource
* @access protected
*/
function getLocalRecordset() {
tNG_log::log('tNG_insert', 'getLocalRecordset');
$fakeArr = array();
$tmpArr = $this->columns;
if (!isset($tmpArr[$this->primaryKey])) {
$tmpArr[$this->primaryKey] = $this->primaryKeyColumn;
$tmpArr[$this->primaryKey]['default'] = NULL;
}
foreach($tmpArr as $colName=>$colDetails) {
$tmpVal = KT_escapeForSql($colDetails['default'], $colDetails['type'], true);
$fakeArr[$colName] = $tmpVal;
}
return $this->getFakeRecordset($fakeArr);
}
/**
* Adds a column to the transaction
* Calls the parent addColumn method then sets the default value.
* @param string $colName The column name
* @param string $type The column type (NUMERYC_TYPE, STRING_TYPE, etc)
* @param string $method The request method (GET, POST, FILE, COOKIE, SESSION)
* @param string $reference The submitted variable name (if method=GET and reference=test, value=$_GET['test'])
* @param string $defaultValue The default value for the current column
* @access public
*/
function addColumn($colName, $type, $method, $reference, $defaultValue = '') {
parent::addColumn($colName, $type, $method, $reference);
if ($method == "VALUE") {
$this->columns[$colName]['default'] = $reference;
} else {
$this->columns[$colName]['default'] = $defaultValue;
}
}
/**
* This function is called once the transaction SQL was actually executed
* And only if the execution was succesffully. On insert, it sets the primary key value if it is not set.
* @access protected
*/
function postExecuteSql() {
tNG_log::log('tNG_insert', 'postExecuteSql');
if (isset($this->columns[$this->primaryKey])) {
$this->primaryKeyColumn['value'] = $this->getColumnValue($this->primaryKey);
} else {
$this->primaryKeyColumn['value'] = $this->connection->Insert_ID($this->table, $this->primaryKey);
}
return null;
}
/**
* if at least one value was submited return true;
* @return boolean
* @access protected
*/
function wereValuesSubmitted() {
$ret = false;
foreach ($this->columns as $colName=>$colDetails) {
if ($colDetails['method'] == 'POST' || $colDetails['method'] == 'FILES') {
if ($colDetails['default'] != $colDetails['value']) {
$ret = true;
break;
}
}
}
return $ret;
}
}
?>
Um outro ficheiro que tem o nome do ficheiro que é referido na linha 30 do anterior (tNG_fields.class.php):
<?php
/*
* ADOBE SYSTEMS INCORPORATED
* Copyright 2007 Adobe Systems Incorporated
* All Rights Reserved
*
* NOTICE: Adobe permits you to use, modify, and distribute this file in accordance with the
* terms of the Adobe license agreement accompanying it. If you have received this file from a
* source other than Adobe, then your use, modification, or distribution of it requires the prior
* written permission of Adobe.
*/
/*
Copyright (c) InterAKT Online 2000-2006. All rights reserved.
*/
/**
* This class adds the "field" concept to the tNG base class.
* Thus, the SQL query will be dinamically-built.
* @abstract
* @access public
*/
class tNG_fields extends tNG {
/**
* List of columns to use when generating the transaction SQL query
* @see addColumn()
* @var array
* @access protected
*/
var $columns = array();
/**
* Primary Key field
* @var string
* @access protected
*/
var $primaryKey = '';
/**
* Primary Key details
* Value, Type, etc
* @var array
* @access protected
*/
var $primaryKeyColumn = array();
/**
* The Primary Key value that is submitted on update
* @var string
* @access protected
*/
var $pkName = 'kt_pk';
/**
* The transaction saved data (before the actual execution)
*/
var $savedData=array();
/**
* Table to use when generating the transaction SQL query
* @var string
* @access protected
*/
var $table = '';
/**
* Evaluates the columns values then executes the Transaction
* @access public
*/
function executeTransaction() {
$this->compileColumnsValues();
parent::executeTransaction();
}
/**
* Adds a column to the transaction
* @see $columns
* @param string $colName The column name
* @param string $type The column type (NUMERIC_TYPE, STRING_TYPE, etc)
* @param string $method The request method (GET, POST, FILE, COOKIE, SESSION)
* @param string $reference The submitted variable name (if method=GET and reference=test, value=$_GET['test'])
* @access public
*/
function addColumn($colName, $type, $method, $reference) {
if ($this->started && ($method != 'VALUE' && $method != 'EXPRESSION')) {
die("You can only add supplemental columns by value or by expression once the transaction is started.");
}
if (!isset($this->columns[$colName])) {
$this->columns[$colName] = array();
}
$this->columns[$colName]['type'] = $type;
$this->columns[$colName]['method'] = $method;
$this->columns[$colName]['reference'] = $reference;
if ($method == 'VALUE') {
$this->columns[$colName]['value'] = $reference;
}
if ($method == 'EXPRESSION') {
$this->columns[$colName]['method'] = "VALUE";
$this->columns[$colName]['reference'] = KT_DynamicData($reference, $this, '', $this->getTransactionType() == "_delete");
if ($type == "NUMERIC_TYPE" || $type == "DOUBLE_TYPE") {
$this->columns[$colName]['reference'] = $this->evaluateNumeric($this->columns[$colName]['reference']);
}
}
if ($this->started) {
tNG_prepareValues($this->columns[$colName]);
}
}
/**
* Evaluates a numeric expression
* @param string $expr - the expression to be evaluated (must contain only: numbers (0 to 9) and the follwing characters: + - * / . ( )
* @return float - the result of the evaluated expresison.
* @access public
*/
function evaluateNumeric($expr) {
$retVal = null;
if ( preg_match("/\d+/",$expr) && preg_match("/^[\d\s\*\-\+\/\.\(\)]+$/",$expr) ) {
$ok = false;
$evalExpr = "\$retVal=".$expr.";\$ok=true;";
@eval($evalExpr);
if ($ok !== true) {
$retVal = null;
$this->setError(new tNG_error('FIELDS_EVAL_EXPR_FAILED', array() ,array($expr)));
}
} else {
if ($GLOBALS['tNG_debug_mode'] == 'DEVELOPMENT') {
$this->setError(new tNG_error('FIELDS_EVAL_EXPR_INVALID', array(), array($expr)));
}
}
return $retVal;
}
/**
* Sets a value for a given column
* @param string $colName - the column to alter
* @param object unknown $colValue - the new value
* @access public
*/
function setColumnValue($colName, $colValue) {
if (isset($this->columns[$colName])) {
$this->columns[$colName]['value'] = $colValue;
$this->columns[$colName]['reference'] = $colValue;
$this->columns[$colName]['method'] = 'VALUE';
} else {
die('tNG_fields.setColumnValue:<br />Column ' . $colName . ' is not part of the current transaction.');
}
}
/**
* Sets a value for a column directly
* @param string $colName - the column to alter
* @param object unknown $colValue - the new value
* @access public
*/
function setRawColumnValue($colName, $colValue) {
if (isset($this->columns[$colName])) {
$this->columns[$colName]['value'] = $colValue;
} else {
die('tNG_fields.setColumnValue:<br />Column ' . $colName . ' is not part of the current transaction.');
}
}
/**
* Gets the value of a column
* @param string $colName
* @return object unknown
* @access public
*/
function getColumnValue($colName) {
if (isset($this->columns[$colName])) {
return $this->columns[$colName]['value'];
} elseif ($colName == $this->getPrimaryKey()) {
return $this->getPrimaryKeyValue();
} else {
die('tNG_fields.getColumnValue:<br />Column ' . $colName . ' is not part of the current transaction.');
}
}
/**
* Gets the reference of a column
* @param string $colName
* @return string
* @access public
*/
function getColumnReference($colName) {
if (isset($this->columns[$colName])) {
return $this->columns[$colName]['reference'];
} else {
die('tNG_fields.getColumnReference:<br />Column ' . $colName . ' is not part of the current transaction.');
}
}
/**
* Gets the type of a column
* @param string $colName
* @return string
* The column type
* @access public
*/
function getColumnType($colName) {
if (isset($this->columns[$colName])) {
return $this->columns[$colName]['type'];
} else {
if ($colName == $this->primaryKey) {
return $this->primaryKeyColumn['type'];
}
die('tNG_fields.getColumnType:<br />Column ' . $colName . ' is not part of the current transaction.');
}
}
/**
* Setter for the transaction SQL table
* @see $table
* @param string $tableName The table name
* @access public
*/
function setTable($tableName) {
if ($this->table == '') {
$this->table = $tableName;
$this->pkName .= "_" . preg_replace("/[^\w]/", "_", $this->table);
} else {
die('tNG_fields.setTable:<br />The table has already been set.');
}
}
/**
* Getter for the transaction SQL table
* @see $table
* @return string
* The table name
* @access public
*/
function getTable() {
return $this->table;
}
/**
* Sets the primary key and its details
* @see $primaryKey, $primaryKeyColumn
* @param string $colName The column name
* @param string $type The column type (NUMERIC_TYPE, STRING_TYPE, etc)
* @param string $method The request method (GET, POST, FILE, COOKIE, SESSION)
* @param string $reference The submitted variable name (if method=GET and reference=test, value=$_GET['test'])
* @access public
*/
function setPrimaryKey($colName, $type, $method='VALUE', $reference=NULL) {
$this->primaryKey = $colName;
$this->primaryKeyColumn['type'] = $type;
$this->primaryKeyColumn['method'] = $method;
$this->primaryKeyColumn['reference'] = $reference;
}
/**
* Gets the primary key column
* @return string
* @access public
*/
function getPrimaryKey() {
return $this->primaryKey;
}
/**
* Gets the primary key value
* @return object unknown
* @access public
*/
function getPrimaryKeyValue() {
if (isset($this->primaryKeyColumn['value'])) {
return $this->primaryKeyColumn['value'];
} else {
return null;
}
}
/**
* Sets for each column the value correspondeing to the reference/method
* @access public
*/
function compileColumnsValues() {
// Use multiple values in kt_pk or from get
$savedPK = $this->primaryKeyColumn;
$this->primaryKeyColumn['method'] = 'POST';
$this->primaryKeyColumn['reference'] = $this->pkName;
tNG_prepareValues($this->primaryKeyColumn);
if (!isset($this->primaryKeyColumn['value'])) {
$this->primaryKeyColumn = $savedPK;
tNG_prepareValues($this->primaryKeyColumn);
}
foreach($this->columns as $colName=>$colDetails) {
tNG_prepareValues($this->columns[$colName]);
}
}
/**
* Get the local recordset associated to this transaction
* This function is to be implemented in subclasses
* @abstract
* @return object resource Recordset resource
*/
function getLocalRecordset() {
$this->setError(new tNG_error('FIELDS_LOCAL_RS', array(), array()));
}
/**
* Creates a fake recordset from the given columns associative array
* This function is called on error or for the insert default values.
* @param array $fakeArr The associative array
* @return object resource Recordset resource
* @access protected
*/
function getFakeRecordset($fakeArr) {
tNG_log::log('tNG' . $this->transactionType, "getFakeRecordset");
$fakeRs = new KT_FakeRecordset($this->connection);
$KT_fakeRs = $fakeRs->getFakeRecordset($fakeArr);
if ($fakeRs->hasError) {
tNG_log::log('KT_ERROR');
$this->setError(new tNG_error('FIELDS_FAKE_RS_ERROR', array(), array($fakeRs->getError())));
$disp = $this->getDispatcher();
die($disp->getErrorMsg());
}
return $KT_fakeRs;
}
/**
* Get the recordset associated to this transaction
* @return object resource Recordset resource
* The fake recordset on error or the local recordset
* @access public
*/
function getRecordset() {
tNG_log::log('tNG' . $this->transactionType, "getRecordset");
if ($this->getError()) {
$ret = $this->getFakeRecordset($this->getFakeRsArr());
} else {
$ret = $this->getLocalRecordset();
}
return $ret;
}
/**
* Prepares the SQL query to be executed
* To be implemented in derived class
* @access protected
*/
function prepareSQL() {
if ($this->table == '') {
return new tNG_error('FIELDS_NO_TABLE', array(), array());
}
}
/**
* Creates a fake recordset array from the current $columns
* This function is called ONLY on error
* @return array associative array with the current values.
* @access protected
*/
function getFakeRsArr() {
tNG_log::log('tNG' . $this->transactionType, "getFakeRsArr");
$localRs = $this->getLocalRecordset();
if (is_resource($localRs)) {
$localRs = new KT_Recordset($localRs);
}
$fakeArr = array();
$tmpArr = $this->columns;
if (!isset($tmpArr[$this->primaryKey]) && trim($this->primaryKey) != '') {
$tmpArr[$this->primaryKey] = $this->primaryKeyColumn;
}
// Transaction was executed and failed, create the recordset from the submitted values
foreach($tmpArr as $colName=>$colDetails) {
if ($colDetails['method'] == "CURRVAL") {
$value = KT_escapeForSql($localRs->Fields($colName), "STRING_TYPE", true);
} else {
$value = KT_escapeForSql($colDetails['value'], "STRING_TYPE", true);
}
$fakeArr[$colName] = $value;
}
$savedPK = $this->getSavedValue($this->primaryKey);
if (!is_null($savedPK)) {
$fakeArr[$this->pkName]=KT_escapeForSql($savedPK, "STRING_TYPE", true);
} else {
$fakeArr[$this->pkName]="";
}
return $fakeArr;
}
/**
* Parses the SQL error
* Calls the parent function then sets the error to a specific column if possible.
* @param string $sql the SQL statement that throwed the error message
* @param string $errorMsg the error text message
* @access protected
*/
function &parseSQLError($sql, $error) {
$errObj = parent::parseSQLError($sql, $error);
if ($errObj != NULL) {
foreach ($this->columns as $colName => $colDetail) {
if (preg_match('/^.*[^a-z]+' . preg_quote($colName,'/') . '[^a-z]+.*$/i', $error)) {
$errObj->setFieldError($colName, '%s', array($error));
break;
}
}
}
return $errObj;
}
/**
* Updates a field after the actual transaction was executed
* @param string $fieldName The field name
* @param string $fieldValue The field value
* @return boolean
* true on success
* false on error
* @access public
*/
function afterUpdateField($fieldName, $fieldValue) {
tNG_log::log('tNG' . $this->transactionType, "afterUpdateField", "$fieldName, $fieldValue");
$keyName = $this->primaryKey;
$keyValue = $this->primaryKeyColumn['value'];
$sql = 'UPDATE '. $this->table . ' SET '.KT_escapeFieldName($fieldName).' = '.KT_escapeForSql($fieldValue,'STRING_TYPE').' WHERE '.KT_escapeFieldName($keyName).' = ' . KT_escapeForSql($keyValue, $this->primaryKeyColumn['type']);
$success = $this->connection->Execute($sql);
if($success === false) {
return new tNG_error('FIELDS_AFTER_UPDATE_ERROR', array(), array($this->connection->ErrorMsg()));
}
return null;
}
/**
* Gets the error message for a specific field, if it exists.
* @param string $fName the field name
* @return string error message
* @access public
*/
function getFieldError($fName) {
$tmp = $this->getError();
if (isset($tmp)) {
return $tmp->getFieldError($fName);
}
}
/**
* Gets the value saved for the given column name
* @param string $colName the name of the column
* @return string
* @access public
*/
function getSavedValue($colName) {
if (isset($this->savedData[$colName])) {
return $this->savedData[$colName];
}
return null;
}
/**
* Retrieve and store the saved values from database;
* @return string
* @access public
*/
function saveData() {
tNG_log::log('tNG' . $this->transactionType, "saveData");
$keyName = $this->getPrimaryKey();
$keyValue = $this->getPrimaryKeyValue();
$keyType = $this->getColumnType($keyName);
$escapedKeyValue = KT_escapeForSql($keyValue, $keyType);
$sql = 'SELECT * FROM ' . $this->getTable() . ' WHERE ' . KT_escapeFieldName($keyName) . ' = ' . $escapedKeyValue;
$rs = $this->connection->Execute($sql);
if ($rs === false) {
return new tNG_error('FIELDS_SAVEDATA_ERROR', array(), array($sql, $this->connection->ErrorMsg()));
}
$this->savedData = $rs->fields;
return null;
}
}
?>
Sobre o assunto (incompatibilidade com PHP 5.3), li em vários forum aqui vai o link de umClique aqui
Olá também uso a barra Developer Toolbox, e me deparei com esse erro, bom procurando encontrei o que vou listar logo abaixo resolveu o meu problema, talvez possa ajudar mais alguém!!!
Nos arquivos que estão dentro da pasta includes\tng
O arquivo tNG_custom.class.php na linha 30
modifique o seguinte:
Padrão:
parent::tNG_fields($connection);
Modificado:
parent::tNG($connection);
Segundo outros forums não BR, pede pra que você modifique também nos seguintes arquivos:
tNG_insert.class.php,
tNG_update.class.php
tNG_delete.class.php
tNG_custom.class.php
tNG_multipleInsert.class.php linha 31
tNG_multipleUpdate.class.php linha 24
tNG_multipleDelete.class.php linha 17
No meu caso foi preciso modificar todos arquivos!!!
Obs: Esse erro aconteceu quando atualizei meu Wampserver com a versão do PHP: 5.3.0
Espero ter ajudado!!!
O artigo onde peguei foi do Joathan F.
Fonte: http://www.adrianogianini.com.br/videoblog/logoff-com-a-barra-developer/
Viva Fábio
Obrigado pela sua ajuda.
Vou testar e depois digo.
Continuação de bom trabalho
http://forum.imasters.com.br/public/style_emoticons/default/clap.gif
Ola xtroino verifiquei aqui o arquivo tNG_custom.class.php é na linha 19 e não na linha 30 como eu tinha postado desculpe o erro!!
/applications/core/interface/imageproxy/imageproxy.php?img=http://img651.imageshack.us/img651/1299/201002112231331.png&key=33abd9b5331af7a4cf59282ef497a31548cdac7d3d9969dc09360fc1c8f69d49" alt="Imagem Postada" />
Olá,
O servidor no qual hospedo alguns sites tb atualizou e agora estou me matando aqui... <_<
Fiz as alterações nos arquivos da pastar "includes/tng" como indicaram, mas agora está dando esse erro quando atualizo/insiro algum registro nas páginas com Developer Toolbox:
Warning: Parameter 2 to Trigger_Default_FormValidation() expected to be a reference, value given in /home/gmempree/public_html/includes/tng/tNG.class.php on line 228
Warning: Cannot modify header information - headers already sent by (output started at /home/gmempree/public_html/includes/tng/tNG.class.php:228) in /home/gmempree/public_html/includes/common/KT_functions.inc.php on line 425
Obs: antes da atualização, o site funcionava perfeitamente...
Desde já agradeço a ajuda...
>
Olá,
O servidor no qual hospedo alguns sites tb atualizou e agora estou me matando aqui... <_<
Fiz as alterações nos arquivos da pastar "includes/tng" como indicaram, mas agora está dando esse erro quando atualizo/insiro algum registro nas páginas com Developer Toolbox:
Warning: Parameter 2 to Trigger_Default_FormValidation() expected to be a reference, value given in /home/gmempree/public_html/includes/tng/tNG.class.php on line 228
Warning: Cannot modify header information - headers already sent by (output started at /home/gmempree/public_html/includes/tng/tNG.class.php:228) in /home/gmempree/public_html/includes/common/KT_functions.inc.php on line 425
Obs: antes da atualização, o site funcionava perfeitamente...
Desde já agradeço a ajuda...
estava com o msm problema q o seu .. e consegui resolver baixando os arquivos nesse site ja prontos para php 5.3
http://www.interaktonline.info/files/40-php-5.3-patches-for-MX-Kollection-3.1.7.html
bastas substituir os arquivos internos na pasta includes (não a pasta toda, se não ai q vai ferra d vez xD)
Depois ele ainda da mais um erro em tNG_custom.class.php, substitua parent::tNG_field($connection); por parent::tNG($connection);
aki funciono d boa =P ( to um pouco atrasado no post mais espero t ajudado)
Obrigada Luis
Tive sorte pois os caras da empresa de alojamento inverteram a alteração. Agora quando fizerem novamente o upgrade vai dar erro.
Sua dica vai ajudar. Vou testar num pc instalando o PHP 5.3.
Valeu
Warning: Parameter 2 to Trigger_Default_FormValidation() expected to be a reference, value given in /home/mundialw/public_html/mirandatransporte/new/includes/tng/tNG.class.php on line 217
Warning: Cannot modify header information - headers already sent by (output started at /home/mundialw/public_html/mirandatransporte/new/includes/tng/tNG.class.php:217) in /home/mundialw/public_html/mirandatransporte/new/includes/common/KT_functions.inc.php on line 425
SE você ESTIVER COM ESSE ERRO
ABRA O ARQUIVO EM /includes/tng/triggers/tNG_defTrigg.inc.php
PROCURE A LINHA
function Trigger_Default_FormValidation
E ALTERE PARA
function Trigger_Default_FormValidation($tNG, $uniVal)
ALTERE SOMENTE ESTA LINHA
O ERRO E DEVIDO AO PHP 5
E AO MYSQL ATUALIZADO OK!! BOA SORTE A TODOS
" JESUS SALVA ACEITE A ELE "
Poste os códigos.