Property "CGridView.data" is not defined - php

I am using Yii framework, I am trying to add something to my database and I get this error:
CException
Property "CGridView.data" is not defined.
C:\wamp\www\testdrive - 18-05-2015\yii\framework\web\CWidgetFactory.php(161)
149 if(isset($this->widgets[$className]))
150 $properties=$properties===array() ? $this->widgets[$className] : CMap::mergeArray($this->widgets[$className],$properties);
151 if($this->enableSkin)
152 {
153 if($this->skinnableWidgets===null || in_array($className,$this->skinnableWidgets))
154 {
155 $skinName=isset($properties['skin']) ? $properties['skin'] : 'default';
156 if($skinName!==false && ($skin=$this->getSkin($className,$skinName))!==array())
157 $properties=$properties===array() ? $skin : CMap::mergeArray($skin,$properties);
158 }
159 }
160 foreach($properties as $name=>$value)
161 $widget->$name=$value;
162 return $widget;
163 }
164
165 /**
166 * Returns the skin for the specified widget class and skin name.
167 * #param string $className the widget class name
168 * #param string $skinName the widget skin name
169 * #return array the skin (name=>value) for the widget
170 */
171 protected function getSkin($className,$skinName)
172 {
173 if(!isset($this->_skins[$className][$skinName]))
Stack Trace
#0
+ C:\wamp\www\testdrive - 18-05-2015\yii\framework\web\CWidgetFactory.php(161): CComponent->__set("data", Document)
#1
+ C:\wamp\www\testdrive - 18-05-2015\yii\framework\web\CBaseController.php(146): CWidgetFactory->createWidget(DocumentController, "zii.widgets.grid.CGridView", array("data" => Document, "attributes" => array("id", "file_id", "timestamp", "description", ...)))
#2
+ C:\wamp\www\testdrive - 18-05-2015\yii\framework\web\CBaseController.php(180): CBaseController->createWidget("zii.widgets.grid.CGridView", array("data" => Document, "attributes" => array("id", "file_id", "timestamp", "description", ...)))
#3
– C:\wamp\www\testdrive - 18-05-2015\private\protected\views\document\view.php(30): CBaseController->widget("zii.widgets.grid.CGridView", array("data" => Document, "attributes" => array("id", "file_id", "timestamp", "description", ...)))
25 'file_id',
26 'timestamp',
27 'description',
28 'content',
29 ),
30 )); ?>
#4
+ C:\wamp\www\testdrive - 18-05-2015\yii\framework\web\CBaseController.php(126): require("C:\wamp\www\testdrive - 18-05-2015\private\protected\views\docum...")
#5
+ C:\wamp\www\testdrive - 18-05-2015\yii\framework\web\CBaseController.php(95): CBaseController->renderInternal("C:\wamp\www\testdrive - 18-05-2015\private\protected\views\docum...", array("model" => Document), true)
#6
+ C:\wamp\www\testdrive - 18-05-2015\yii\framework\web\CController.php(869): CBaseController->renderFile("C:\wamp\www\testdrive - 18-05-2015\private\protected\views\docum...", array("model" => Document), true)
#7
+ C:\wamp\www\testdrive - 18-05-2015\yii\framework\web\CController.php(782): CController->renderPartial("view", array("model" => Document), true)
#8
– C:\wamp\www\testdrive - 18-05-2015\private\protected\controllers\DocumentController.php(56): CController->render("view", array("model" => Document))
51 */
52 public function actionView($id)
53 {
54 $this->render('view',array(
55 'model'=>$this->loadModel($id),
56 ));
57 }
58
59 /**
60 * Creates a new model.
61 * If creation is successful, the browser will be redirected to the 'view' page.
#9
unknown(0): DocumentController->actionView("13")
#10
+ C:\wamp\www\testdrive - 18-05-2015\yii\framework\web\actions\CAction.php(109): ReflectionMethod->invokeArgs(DocumentController, array("13"))
#11
+ C:\wamp\www\testdrive - 18-05-2015\yii\framework\web\actions\CInlineAction.php(47): CAction->runWithParamsInternal(DocumentController, ReflectionMethod, array("id" => "13"))
#12
+ C:\wamp\www\testdrive - 18-05-2015\yii\framework\web\CController.php(308): CInlineAction->runWithParams(array("id" => "13"))
#13
+ C:\wamp\www\testdrive - 18-05-2015\yii\framework\web\filters\CFilterChain.php(133): CController->runAction(CInlineAction)
#14
+ C:\wamp\www\testdrive - 18-05-2015\yii\framework\web\filters\CFilter.php(40): CFilterChain->run()
#15
+ C:\wamp\www\testdrive - 18-05-2015\yii\framework\web\CController.php(1145): CFilter->filter(CFilterChain)
#16
+ C:\wamp\www\testdrive - 18-05-2015\yii\framework\web\filters\CInlineFilter.php(58): CController->filterAccessControl(CFilterChain)
#17
+ C:\wamp\www\testdrive - 18-05-2015\yii\framework\web\filters\CFilterChain.php(130): CInlineFilter->filter(CFilterChain)
#18
+ C:\wamp\www\testdrive - 18-05-2015\yii\framework\web\CController.php(291): CFilterChain->run()
#19
+ C:\wamp\www\testdrive - 18-05-2015\yii\framework\web\CController.php(265): CController->runActionWithFilters(CInlineAction, array("accessControl", "postOnly + delete"))
#20
+ C:\wamp\www\testdrive - 18-05-2015\yii\framework\web\CWebApplication.php(282): CController->run("view")
#21
+ C:\wamp\www\testdrive - 18-05-2015\yii\framework\web\CWebApplication.php(141): CWebApplication->runController("document/view")
#22
+ C:\wamp\www\testdrive - 18-05-2015\yii\framework\base\CApplication.php(184): CWebApplication->processRequest()
#23
– C:\wamp\www\testdrive - 18-05-2015\public\index.php(18): CApplication->run()
13 defined('YII_DEBUG') or define('YII_DEBUG',true);
14 // specify how many levels of call stack should be shown in each log message
15 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
16
17 require_once($yii);
18 Yii::createWebApplication($config)->run();
19 ?>
I am not sure what goes wrong exactly. I have 4 other tables in my database and this is the only one that it wont work and it gives an error.
Can you maybe explain to me what goes wrong?? is the problem from my database??
Later on it adds the record to the database even if it give an error before.

CGridView displays a list of data items in terms of a table.
Exception because CGidView not have property 'data'. Class have property 'dataProvider'. Here is an easy example of CGridView. You can use GII for generation examples from your models.
// in your view.
$this->widget('zii.widgets.grid.CGridView', array(
'id' => 'document',
// you can't use key 'data' here
'dataProvider' => $document->search(), // #var Document $document - your model
'columns' => array(
'id',
// ... other properties
)
));
// in model Document
public function search()
{
$criteria = new CDbCriteria();
$criteria->compare('id',$this->id);
//$criteria->compare('one_more_poperty', $this->one_more_poperty);
...
return new CActiveDataProvider($this, array(
'criteria'=>$criteria,
));
}

Related

swiftmailer and Yii2 not working 1 out of 10 time

I have a background process sending email to me when specific event occur.
It's working most of the time (9 out of 10), but sometime I get the following error message :
PHP Warning 'yii\base\ErrorException' with message 'fwrite(): SSL: An established connection was aborted by the software in your host machine.'
in E:\ProgramData\htdocs\Yii2_KB\vendor\swiftmailer\swiftmailer\lib\classes\Swift\Transport\StreamBuffer.php:232
Stack trace:
#0 [internal function]: yii\base\ErrorHandler->handleError(2, 'fwrite(): SSL: ...', 'E:\ProgramData\...', 232, Array)
#1 E:\ProgramData\htdocs\Yii2_KB\vendor\swiftmailer\swiftmailer\lib\classes\Swift\Transport\StreamBuffer.php(232): fwrite(Resource id #481, 'MAIL FROM:<MTE#...')
#2 E:\ProgramData\htdocs\Yii2_KB\vendor\swiftmailer\swiftmailer\lib\classes\Swift\ByteStream\AbstractFilterableInputStream.php(171): Swift_Transport_StreamBuffer->_commit('MAIL FROM:<MTE#...')
#3 E:\ProgramData\htdocs\Yii2_KB\vendor\swiftmailer\swiftmailer\lib\classes\Swift\ByteStream\AbstractFilterableInputStream.php(90): Swift_ByteStream_AbstractFilterableInputStream->_doWrite('MAIL FROM:<MTE#...')
#4 E:\ProgramData\htdocs\Yii2_KB\vendor\swiftmailer\swiftmailer\lib\classes\Swift\Transport\AbstractSmtpTransport.php(276): Swift_ByteStream_AbstractFilterableInputStream->write('MAIL FROM:<MTE#...')
#5 E:\ProgramData\htdocs\Yii2_KB\vendor\swiftmailer\swiftmailer\lib\classes\Swift\Transport\EsmtpTransport.php(243): Swift_Transport_AbstractSmtpTransport->executeCommand('MAIL FROM:<MTE#...', Array, Array)
#6 E:\ProgramData\htdocs\Yii2_KB\vendor\swiftmailer\swiftmailer\lib\classes\Swift\Transport\EsmtpTransport.php(322): Swift_Transport_EsmtpTransport->executeCommand('MAIL FROM:<MTE#...', Array)
#7 E:\ProgramData\htdocs\Yii2_KB\vendor\swiftmailer\swiftmailer\lib\classes\Swift\Transport\AbstractSmtpTransport.php(416): Swift_Transport_EsmtpTransport->_doMailFromCommand('MTE#...')
#8 E:\ProgramData\htdocs\Yii2_KB\vendor\swiftmailer\swiftmailer\lib\classes\Swift\Transport\AbstractSmtpTransport.php(444): Swift_Transport_AbstractSmtpTransport->_doMailTransaction(Object(Swift_Message), 'MTE#...', Array, Array)
#9 E:\ProgramData\htdocs\Yii2_KB\vendor\swiftmailer\swiftmailer\lib\classes\Swift\Transport\AbstractSmtpTransport.php(176): Swift_Transport_AbstractSmtpTransport->_sendTo(Object(Swift_Message), 'MTE#...', Array, Array)
#10 E:\ProgramData\htdocs\Yii2_KB\vendor\swiftmailer\swiftmailer\lib\classes\Swift\Mailer.php(85): Swift_Transport_AbstractSmtpTransport->send(Object(Swift_Message), Array)
#11 E:\ProgramData\htdocs\Yii2_KB\vendor\yiisoft\yii2-swiftmailer\Mailer.php(146): Swift_Mailer->send(Object(Swift_Message))
#12 E:\ProgramData\htdocs\Yii2_KB\vendor\yiisoft\yii2\mail\BaseMailer.php(260): yii\swiftmailer\Mailer->sendMessage(Object(yii\swiftmailer\Message))
#13 E:\ProgramData\htdocs\Yii2_KB\vendor\yiisoft\yii2\mail\BaseMessage.php(48): yii\mail\BaseMailer->send(Object(yii\swiftmailer\Message))
#14 E:\ProgramData\htdocs\Yii2_KB\controllers\BackgroundTask.php(172): yii\mail\BaseMessage->send()
#15 E:\ProgramData\htdocs\Yii2_KB\vendor\bazilio\yii2-async\commands\AsyncWorkerCommand.php(29): app\controllers\BackgroundTask->execute()
#16 [internal function]: bazilio\async\commands\AsyncWorkerCommand->actionDaemon('background')
#17 E:\ProgramData\htdocs\Yii2_KB\vendor\yiisoft\yii2\base\InlineAction.php(55): call_user_func_array(Array, Array)
#18 E:\ProgramData\htdocs\Yii2_KB\vendor\yiisoft\yii2\base\Controller.php(151): yii\base\InlineAction->runWithParams(Array)
#19 E:\ProgramData\htdocs\Yii2_KB\vendor\yiisoft\yii2\console\Controller.php(91): yii\base\Controller->runAction('daemon', Array)
#20 E:\ProgramData\htdocs\Yii2_KB\vendor\yiisoft\yii2\base\Module.php(455): yii\console\Controller->runAction('daemon', Array)
#21 E:\ProgramData\htdocs\Yii2_KB\vendor\yiisoft\yii2\console\Application.php(167): yii\base\Module->runAction('async-worker/da...', Array)
#22 E:\ProgramData\htdocs\Yii2_KB\vendor\yiisoft\yii2\console\Application.php(143): yii\console\Application->runAction('async-worker/da...', Array)
#23 E:\ProgramData\htdocs\Yii2_KB\vendor\yiisoft\yii2\base\Application.php(375): yii\console\Application->handleRequest(Object(yii\console\Request))
#24 E:\ProgramData\htdocs\Yii2_KB\yii(23): yii\base\Application->run()
#25 {main}
PHP Warning: fwrite(): SSL operation failed with code 1. OpenSSL Error messages:
error:1409F07F:SSL routines:SSL3_WRITE_PENDING:bad write retry in E:\ProgramData\htdocs\Yii2_KB\vendor\swiftmailer\swiftmailer\lib\classes\Swift\Transport\StreamBuffer.php on line 232
Here follow my configuration for the mailer :
'mailer' => [
'class' => 'yii\swiftmailer\Mailer',
'transport' => [
'class' => 'Swift_SmtpTransport',
'host' => 'x.x.x.xxx',
'username' => 'xxx',
'password' => 'XyXyXy',
'port' => '25',
'encryption' => 'tls',
],
],
I'm using Yii 2.0.6
PHP Version : 5.5.9
Mail server : Exchange Server 2010
When it fail, it's mostly after a period of inactivity between 2 events ( a few hours).
Any ideas ?
Thanks to ineersa for the tips.
I've added the following code in the beginning of the background process, and now it's working.
if (Yii::$app->mailer->getTransport()->isStarted()) {
Yii::$app->mailer->getTransport()->stop();
}
Yii::$app->mailer->getTransport()->start();

pdo exception when trying to access firebird

I have to access firebird with php and zend framework 2 and I'm having the following error:
/var/www/html/cad/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver /Pdo/Statement.php:187
Message:
SQLSTATE[HY000]: General error: -204 Dynamic SQL Error SQL error code = -204 Table unknown pessoa At line 1, column 19
Stack trace:
#0 /var/www/html/cad/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver /Pdo/Statement.php(187): PDO->prepare('SELECT "pessoa"...')
#1 /var/www/html/cad/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Pdo/Statement.php(213): Zend\Db\Adapter\Driver\Pdo\Statement->prepare()
#2 /var/www/html/cad/vendor/zendframework/zendframework/library/Zend/Db/TableGateway/AbstractTableGateway.php(233): Zend\Db\Adapter\Driver\Pdo\Statement->execute()
#3 /var/www/html/cad/vendor/zendframework/zendframework/library/Zend/Db/TableGateway/AbstractTableGateway.php(208): Zend\Db\TableGateway\AbstractTableGateway->executeSelect(Object(Zend\Db\Sql\Select))
#4 /var/www/html/cad/vendor/zendframework/zendframework/library/Zend/Db/TableGateway/AbstractTableGateway.php(195): Zend\Db\TableGateway\AbstractTableGateway->selectWith(Object(Zend\Db\Sql\Select))
#5 /var/www/html/cad/module/Pessoa/src/Pessoa/Model/PessoaTable.php(18): Zend\Db\TableGateway\AbstractTableGateway->select()
#6 /var/www/html/cad/module/Pessoa/src/Pessoa/Controller/PessoaController.php(26): Pessoa\Model\PessoaTable->fetchAll()
#7 /var/www/html/cad/vendor/zendframework/zendframework/library/Zend/Mvc/Controller/AbstractActionController.php(83): Pessoa\Controller\PessoaController->indexAction()
#8 [internal function]: Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
#9 /var/www/html/cad/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(468): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#10 /var/www/html/cad/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(207): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#11 /var/www/html/cad/vendor/zendframework/zendframework/library/Zend/Mvc/Controller/AbstractController.php(117): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#12 /var/www/html/cad/vendor/zendframework/zendframework/library/Zend/Mvc/DispatchListener.php(114): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
#13 [internal function]: Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#14 /var/www/html/cad/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(468): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#15 /var/www/html/cad/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(207): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#16 /var/www/html/cad/vendor/zendframework/zendframework/library/Zend/Mvc/Application.php(313): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#17 /var/www/html/cad/public/index.php(17): Zend\Mvc\Application->run()
#18 {main}
Global.php
return array(
'db' => array(
'driver' => 'Pdo',
'dsn' => 'firebird:dbname=/opt/bancos/teste.fdb', //array(PDO::ATTR_PERSISTENT => true),
/*'driver_options' => array(
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\''
),*/
),
'service_manager' => array(
'factories' => array(
'Zend\Db\Adapter\Adapter'
=> 'Zend\Db\Adapter\AdapterServiceFactory',
),
),
);
?>
local.php
<?php
return array(
'db' => array(
'username' => 'sysdba',
'password' => 'masterkey',
),
);
?>
PessoaController.php
public function indexAction()
{
return new ViewModel(array(
'pessoas' => $this->getPessoaTable()->fetchAll(),
));
}
PessoaTable.php
public function fetchAll()
{
try{
$resultSet = $this->tableGateway->select();
} catch(Exception $e){
$e->getMessage();
}
return $resultSet;
}
and here is the method getPessoaTable()
public function getPessoaTable()
{
if (!$this->pessoaTable) {
$sm = $this->getServiceLocator();
$this->pessoaTable = $sm->get('Pessoa\Model\PessoaTable');
}
return $this->pessoaTable;
}
I have configured pdo_firebird.so in php. And it shows up on phpinfo()
The important part of the error is: "Table unknown pessoa". You are selecting from a table pessoa, no such table exists according to Firebird. The fact that pessoa is lower case in the error message shows you are using quoted identifiers. Quoted identifiers are case sensitive in Firebird. Unquoted identifiers are upper cased to make them case insensitive.
So this error either means the table really doesn't exist, or - as you use quoted identifiers - the table name is actually PESSOA. The rules Firebird uses for quoted/unquoted identifiers will make SELECT ... FROM pessoa work, but SELECT ... FROM "pessoa" fail.
I don't know PDO, so I can't give a PDO specific help, but I hope this narrows it down for you.

Error With Parsing $_Post Data In Controller, And Rendering Cgridview

i'm facing a problem passing the correct value to the grid widget in the view. The data is being passed from jquery using ajax.
Here is the code::
$('#find-product').click(function(e) {
e.preventDefault();
alert($('#find-product').data("url"));
/*
* Make the ajax call to send the selected option to the controller for processing
* URL : $('#find-product').data("url") , the path of the controller's action
* Dropdown : the obejct that is passed to the controller
*
* Dropdown.category : the category selected
* Dropdown.price : the price range selected
*
*
*/
$.ajax({
url: $('#find-product').data("url"),
data: {
Dropdown: {
category: $('#supp-category').find(":selected").text(),
price: $('#supp-price').find(":selected").text()
}
},
type: "POST",
error: function(xhr, tStatus, e) {
if (!xhr) {
alert(" We have an error ");
alert(tStatus + " " + e.message);
} else {
alert("else: " + e.message); // the great unknown
}
},
success: function(resp) {
document.location.href = $('#find-product').data("url");
}
})
});
So i want to send the object named Dropdown to the controller action. In this case its /products/dropdown.
In the actionDropdown() i'm trying to form a CDbCriteria and passing it to CActiveDataProvider so that i may use it to render the grid.
Here is the code for the actionDropdown in the ProductsController ::
public function actionDropdown() {
$criteria = new CDbCriteria;
$criteria->compare('category', $_POST['Dropdown']['category'], true);
$dataProvider = new CActiveDataProvider('Products', array(
'criteria' => $criteria,
));
$this->render('selectproducts', array(
'dataProvider' => $dataProvider,
));
}
And here is the view, called selectproducts.
<div class="row">
<?php
$this->widget('bootstrap.widgets.TbGridView', array(
'id' => 'products-grid',
'dataProvider' => $dataProvider,
'filter' => $dataProvider,
'columns' => array(
'id',
'name',
'category',
'brand',
'weight_unit',
'price_unit',
'flavors',
'providers',
),
));
?>
</div>
Now this is giving me an CException error. Here is the error stack trace::
CException
CActiveDataProvider and its behaviors do not have a method or closure named "getValidators". (/var/www/html/yii/framework/base/CComponent.php:266)
#0 /var/www/html/yii/framework/web/helpers/CHtml.php(2236): CComponent->__call('getValidators', Array)
#1 /var/www/html/yii/framework/web/helpers/CHtml.php(2236): CActiveDataProvider->getValidators('id')
#2 /var/www/html/yii/framework/web/helpers/CHtml.php(1434): CHtml::activeInputField('text', Object(CActiveDataProvider), 'id', Array)
#3 /var/www/html/EasyAesthetics/protected/extensions/yiibooster/widgets/TbDataColumn.php(109): CHtml::activeTextField(Object(CActiveDataProvider), 'id', Array)
#4 /var/www/html/EasyAesthetics/protected/extensions/yiibooster/widgets/TbDataColumn.php(74): TbDataColumn->renderFilterCellContent()
#5 /var/www/html/yii/framework/zii/widgets/grid/CGridView.php(532): TbDataColumn->renderFilterCell()
#6 /var/www/html/yii/framework/zii/widgets/grid/CGridView.php(510): CGridView->renderFilter()
#7 /var/www/html/yii/framework/zii/widgets/grid/CGridView.php(480): CGridView->renderTableHeader()
#8 /var/www/html/yii/framework/zii/widgets/CBaseListView.php(167): CGridView->renderItems()
#9 [internal function]: CBaseListView->renderSection(Array)
#10 /var/www/html/yii/framework/zii/widgets/CBaseListView.php(150): preg_replace_callback('/{(\w+)}/', Array, '{summary}?{item...')
#11 /var/www/html/yii/framework/zii/widgets/CBaseListView.php(135): CBaseListView->renderContent()
#12 /var/www/html/yii/framework/web/CBaseController.php(173): CBaseListView->run()
#13 /var/www/html/EasyAesthetics/protected/views/products/selectproducts.php(37): CBaseController->widget('bootstrap.widge...', Array)
#14 /var/www/html/yii/framework/web/CBaseController.php(126): require('/var/www/html/E...')
#15 /var/www/html/yii/framework/web/CBaseController.php(95): CBaseController->renderInternal('/var/www/html/E...', Array, true)
#16 /var/www/html/yii/framework/web/CController.php(869): CBaseController->renderFile('/var/www/html/E...', Array, true)
#17 /var/www/html/yii/framework/web/CController.php(782): CController->renderPartial('selectproducts', Array, true)
#18 /var/www/html/EasyAesthetics/protected/controllers/ProductsController.php(248): CController->render('selectproducts', Array)
#19 /var/www/html/yii/framework/web/actions/CInlineAction.php(49): ProductsController->actionDropdown()
#20 /var/www/html/yii/framework/web/CController.php(308): CInlineAction->runWithParams(Array)
#21 /var/www/html/yii/framework/web/filters/CFilterChain.php(133): CController->runAction(Object(CInlineAction))
#22 /var/www/html/yii/framework/web/filters/CFilter.php(40): CFilterChain->run()
#23 /var/www/html/yii/framework/web/CController.php(1145): CFilter->filter(Object(CFilterChain))
#24 /var/www/html/yii/framework/web/filters/CInlineFilter.php(58): CController->filterAccessControl(Object(CFilterChain))
#25 /var/www/html/yii/framework/web/filters/CFilterChain.php(130): CInlineFilter->filter(Object(CFilterChain))
#26 /var/www/html/yii/framework/web/CController.php(291): CFilterChain->run()
#27 /var/www/html/yii/framework/web/CController.php(265): CController->runActionWithFilters(Object(CInlineAction), Array)
#28 /var/www/html/yii/framework/web/CWebApplication.php(282): CController->run('dropdown')
#29 /var/www/html/yii/framework/web/CWebApplication.php(141): CWebApplication->runController('products/dropdo...')
#30 /var/www/html/yii/framework/base/CApplication.php(180): CWebApplication->processRequest()
#31 /var/www/html/EasyAesthetics/index.php(13): CApplication->run()
#32 {main}
I cannot for the life of me figure out what is causing this error. Please provide any sort of help, any tip that will head me in the right direction.
Thanks, in advance.
Maxx
The problem is with filter param in TbGridView. Filter must be instance of your model, not dataprovider.
$this->widget('bootstrap.widgets.TbGridView', array(
'id' => 'products-grid',
'dataProvider' => $dataProvider,
'filter' => $dataProvider->model, // Simplest way
'columns' => array(
'id',
'name',
'category',
'brand',
'weight_unit',
'price_unit',
'flavors',
'providers',
),
));
Or just assign YourModel::model() as your filter param.

Swift_TransportException Failed to authenticate on SMTP server with username

Hey awesome programmers!
Glad to see you all :)
This is my site... http://www.newdelhifreeads.com
I use cpanel.
This type of question has been asked but mine is a little different.
Whenever anyone tries to register on my site or try to post a free ad, the following error message results:
Swift_Transport Exception
Failed to authenticate on SMTP server with username "info#newdelhifreeads.com" using 2 possible authenticators
/home/newdelhi/public_html/protected/modules/Core/extensions/vendors/mail/vendors/swiftMailer/classes/Swift/Transport/Esmtp/AuthHandler.php(179)
167 foreach ($this->_getAuthenticatorsForAgent() as $authenticator)
168 {
169 if (in_array(strtolower($authenticator->getAuthKeyword()),
170 array_map('strtolower', $this->_esmtpParams)))
171 {
172 $count++;
173 if ($authenticator->authenticate($agent, $this->_username, $this->_password))
174 {
175 return;
176 }
177 }
178 }
179 throw new Swift_TransportException(
180 'Failed to authenticate on SMTP server with username "' .
181 $this->_username . '" using ' . $count . ' possible authenticators'
182 );
183 }
184 }
185
186 /**
187 * Not used.
188 */
189 public function getMailParams()
190 {
191 return array();
Stack Trace
#0
– /home/newdelhi/public_html/protected/modules/Core/extensions/vendors/mail/vendors/swiftMailer/classes/Swift/Transport/EsmtpTransport.php(252): Swift_Transport_Esmtp_AuthHandler->afterEhlo(Swift_SmtpTransport)
247
248 $this->_capabilities = $this->_getCapabilities($response);
249 $this->_setHandlerParams();
250 foreach ($this->_getActiveHandlers() as $handler)
251 {
252 $handler->afterEhlo($this);
253 }
254 }
255
256 /** Overridden to add Extension support */
257 protected function _doMailFromCommand($address)
#1
– /home/newdelhi/public_html/protected/modules/Core/extensions/vendors/mail/vendors/swiftMailer/classes/Swift/Transport/AbstractSmtpTransport.php(108): Swift_Transport_EsmtpTransport->_doHeloCommand()
103 catch (Swift_TransportException $e)
104 {
105 $this->_throwException($e);
106 }
107 $this->_readGreeting();
108 $this->_doHeloCommand();
109
110 if ($evt)
111 {
112 $this->_eventDispatcher->dispatchEvent($evt, 'transportStarted');
113 }
#2
– /home/newdelhi/public_html/protected/modules/Core/extensions/vendors/mail/vendors/swiftMailer/classes/Swift/Mailer.php(74): Swift_Transport_AbstractSmtpTransport->start()
69 {
70 $failedRecipients = (array) $failedRecipients;
71
72 if (!$this->_transport->isStarted())
73 {
74 $this->_transport->start();
75 }
76
77 return $this->_transport->send($message, $failedRecipients);
78 }
79
#3
+ /home/newdelhi/public_html/protected/modules/Core/extensions/vendors/mail/YiiMail.php(133): Swift_Mailer->send(Swift_Message, array())
#4
+ /home/newdelhi/public_html/protected/modules/User/services/UserService.php(311): YiiMail->send(YiiMailMessage)
#5
+ /home/newdelhi/public_html/protected/modules/Core/extensions/base/FSM.php(106): UserService->registerInFrontEnd(array("User" => array("email" => "tips4youawesome#gmail.com", "first_name" => "Naveen", "last_name" => "Gift", "verifyCode" => "uumohu"), "btnRegister" => "Register"))
#6
+ /home/newdelhi/public_html/protected/modules/Core/extensions/base/FSM.php(133): FSM::_run("User.User.registerInFrontEnd", array("User" => array("email" => "tips4youawesome#gmail.com", "first_name" => "Naveen", "last_name" => "Gift", "verifyCode" => "uumohu"), "btnRegister" => "Register"), false)
#7
+ /home/newdelhi/public_html/protected/controllers/SiteController.php(139): FSM::run("User.User.registerInFrontEnd", array("User" => array("email" => "tips4youawesome#gmail.com", "first_name" => "Naveen", "last_name" => "Gift", "verifyCode" => "uumohu"), "btnRegister" => "Register"))
#8
+ /home/newdelhi/public_html/yii-1.1.7.r3135/framework/web/actions/CInlineAction.php(50): SiteController->actionRegister()
#9
+ /home/newdelhi/public_html/yii-1.1.7.r3135/framework/web/CController.php(300): CInlineAction->runWithParams(array())
#10
+ /home/newdelhi/public_html/yii-1.1.7.r3135/framework/web/CController.php(278): CController->runAction(CInlineAction)
#11
+ /home/newdelhi/public_html/yii-1.1.7.r3135/framework/web/CController.php(257): CController->runActionWithFilters(CInlineAction, array())
#12
+ /home/newdelhi/public_html/yii-1.1.7.r3135/framework/web/CWebApplication.php(328): CController->run("register")
#13
+ /home/newdelhi/public_html/yii-1.1.7.r3135/framework/web/CWebApplication.php(121): CWebApplication->runController("site/register")
#14
+ /home/newdelhi/public_html/yii-1.1.7.r3135/framework/base/CApplication.php(155): CWebApplication->processRequest()
#15
+ /home/`newdelhi`/public_html/`index.php`(42): `CApplication`->run()
Could anyone please help me out with this?
It would be a great help!
Thanks.......... ;)
This might be old but somebody might get help through this. I too faced the same problem and received a mail on my gmail account stating that someone is trying to hack your account through an email client or a different site.
THen I searched and found that doing below would resolve this issue.
Go to https://accounts.google.com/UnlockCaptcha‎
and unlock your account for access through other media/sites.
UPDATE : 2015
Also, you can try this, Go to https://myaccount.google.com/security#connectedapps
At the bottom, towards right there is an option "Allow less secure apps". If it is "OFF", turn it on by sliding the button.

zend doctrine couldn't find class

Executing in method checkUnique the line $res=$select->fetchArray(); in the following class I get an error which I cannot solve.
I think it is due to the naming conventions zend autoloader
class Twit_Model_Owners extends Twit_Model_BaseOwners {
function checkUnique($username) {
$con = Doctrine_Manager::getInstance()->connection();
$select = $con->createQuery();
$select->from($this->getTable()->getTableName(), array('loginName'))
->where('loginName=?', $username);
$res=$select->fetchArray();
if (empty($res)) {
return true;
}
return false;
}
}
The exception:
Application error
Exception information:
Message: Couldn't find class Owners
Stack trace:
#0 /usr/share/php/Doctrine/lib/Doctrine/Table.php(256): Doctrine_Table->initDefinition()
#1 /usr/share/php/Doctrine/lib/Doctrine/Connection.php(1126): Doctrine_Table->__construct('Owners', Object(Doctrine_Connection_Mysql), true)
#2 /usr/share/php/Doctrine/lib/Doctrine/Query.php(1942): Doctrine_Connection->getTable('Owners')
#3 /usr/share/php/Doctrine/lib/Doctrine/Query.php(1740): Doctrine_Query->loadRoot('Owners', 'Owners')
#4 /usr/share/php/Doctrine/lib/Doctrine/Query/From.php(88): Doctrine_Query->load('Owners')
#5 /usr/share/php/Doctrine/lib/Doctrine/Query/Abstract.php(2077): Doctrine_Query_From->parse('Owners')
#6 /usr/share/php/Doctrine/lib/Doctrine/Query.php(1167): Doctrine_Query_Abstract->_processDqlQueryPart('from', Array)
#7 /usr/share/php/Doctrine/lib/Doctrine/Query.php(1133): Doctrine_Query->buildSqlQuery(true)
#8 /usr/share/php/Doctrine/lib/Doctrine/Query/Abstract.php(958): Doctrine_Query->getSqlQuery(Array)
#9 /usr/share/php/Doctrine/lib/Doctrine/Query/Abstract.php(1026): Doctrine_Query_Abstract->_execute(Array)
#10 /usr/share/php/Doctrine/lib/Doctrine/Query.php(267): Doctrine_Query_Abstract->execute(Array, 3)
#11 /var/www/twit/application/models/Owners.php(20): Doctrine_Query->fetchArray()
#12 /var/www/twit/application/controllers/AuthController.php(62): Twit_Model_Owners->checkUnique('a')
#13 /usr/share/php/libzend-framework-php/Zend/Controller/Action.php(516): AuthController->signupAction()
#14 /usr/share/php/libzend-framework-php/Zend/Controller/Dispatcher/Standard.php(295): Zend_Controller_Action->dispatch('signupAction')
#15 /usr/share/php/libzend-framework-php/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#16 /usr/share/php/libzend-framework-php/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front->dispatch()
#17 /usr/share/php/libzend-framework-php/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
#18 /var/www/twit/public/index.php(30): Zend_Application->run()
#19 {main}
Request Parameters:
array (
'module' => 'default',
'controller' => 'auth',
'action' => 'signup',
'username' => 'a',
'password' => 'x',
'confirmPassword' => 'x',
'captcha' =>
array (
'id' => 'ae5e3ce58bcf69e25ccdbba601029325',
'input' => 'hen753',
),
'register' => 'Sign up',
)
I can instantiate models without problem. This is the code i use to generate models:
Doctrine::generateModelsFromDb('/var/www/twit/application/models', array('zenddb'), array(
'baseClassesDirectory' => '',
'classPrefix' => 'Twit_Model_',
'classPrefixFiles' => false
));
Furthermore, if you want, you can visit the sample page here and get the error by yourself here.
http://94.94.19.135/twit/public/index.php/signup
It seems that Doctrine does not want the name of the table, as returned by $this->getTable()->getTableName()
but the name of the object (in my case Twit_Model_Owners)
personally I cannot understand such choice (to abstract is ok but at least the name of the tables in the query builder should be mantained), but I complain.

Categories