Issues

Issue #37 resolved

Array to string conversion

Anonymous created an issue

Configuration Error:

PHP notice

Array to string conversion

C:\wamp\www\external\jgb\yii\framework\db\CDbCommand.php(336)

324 else 325 $par=''; 326 Yii::trace('Executing SQL: '.$this->getText().$par,'system.db.CDbCommand'); 327 try 328 { 329 if($this->_connection->enableProfiling) 330 Yii::beginProfile('system.db.CDbCommand.execute('.$this->getText().$par.')','system.db.CDbCommand.execute'); 331 332 $this->prepare(); 333 if($params===array()) 334 $this->_statement->execute(); 335 else 336 $this->_statement->execute($params); 337 $n=$this->_statement->rowCount(); 338 339 if($this->_connection->enableProfiling) 340 Yii::endProfile('system.db.CDbCommand.execute('.$this->getText().$par.')','system.db.CDbCommand.execute'); 341 342 return $n; 343 } 344 catch(Exception $e) 345 { 346 if($this->_connection->enableProfiling) 347 Yii::endProfile('system.db.CDbCommand.execute('.$this->getText().$par.')','system.db.CDbCommand.execute'); 348 $errorInfo = $e instanceof PDOException ? $e->errorInfo : null;

Stack Trace

0

+ C:\wamp\www\external\jgb\yii\framework\db\CDbCommand.php(336): PDOStatement->execute(array(":name" => "PostUpdateOwn", ":type" => 0, ":description" => array("userid" => "1"), ":bizrule" => null, ...))

1

+ C:\wamp\www\external\jgb\yii\framework\db\CDbCommand.php(1178): CDbCommand->execute(array(":name" => "PostUpdateOwn", ":type" => 0, ":description" => array("userid" => "1"), ":bizrule" => null, ...))

2

– C:\wamp\www\external\jgb\yii\demos\blog_cruge\protected\modules\cruge\components\CrugeAuthManager.php(706): CDbCommand->insert("cruge_authitem", array("name" => "PostUpdateOwn", "type" => 0, "description" => array("userid" => "1"), "bizrule" => null, ...))

701 'name'=>$name, 702 'type'=>$type, 703 'description'=>$description, 704 'bizrule'=>$bizRule, 705 'data'=>serialize($data) 706 )); 707 return new CAuthItem($this,$name,$type,$description,$bizRule,$data); 708 } 709 710 /** 711 * Removes the specified authorization item.

3

– C:\wamp\www\external\jgb\yii\demos\blog_cruge\protected\modules\cruge\components\CrugeWebUser.php(112): CrugeAuthManager->createAuthItem("PostUpdateOwn", 0, array("userid" => "1"))

107 // esto no es eficiente en ambientes de produccion ya configurados plenamente 108 // por tanto cuando se hayan establecido todos los permisos entonces 109 // habra que deshabilitar este flag (rbacSetupEnabled) en la configuracion mayor 110 if(!$this->getrbac()->getAuthItem($itemName)) 111 $this->getrbac()->createAuthItem($itemName,CAuthItem::TYPE_OPERATION 112 ,$descripcion); 113 } 114 115 if($this->isSuperAdmin){ 116 return true; 117 }

4

– C:\wamp\www\external\jgb\yii\demos\blog_cruge\protected\views\post_view.php(21): CrugeWebUser->checkAccess("PostUpdateOwn", array("userid" => "1"))

16 <b>Tags:</b> 17 <?php echo implode(', ', $data->tagLinks); ?> 18 <br/> 19 <?php echo CHtml::link('Permalink', $data->url); ?> | 20 <?php echo CHtml::link("Comments ({$data->commentCount})",$data->url.'#comments'); ?> | 21 <?php if( Yii::app()->user->checkAccess('PostUpdateOwn', array('userid'=>$data->author_id))): ?> 22 <?php echo CHtml::link('Update', array('/post/update','id'=>$data->id)); ?> | 23 <?php endif; ?> 24 Last updated on <?php echo date('F j, Y',$data->update_time); ?> 25 </div> 26 </div>

5

+ C:\wamp\www\external\jgb\yii\framework\web\CBaseController.php(131): require("C:\wamp\www\external\jgb\yii\demos\blog_cruge\protected\views\po...")

6

+ C:\wamp\www\external\jgb\yii\framework\web\CBaseController.php(96): CBaseController->renderInternal("C:\wamp\www\external\jgb\yii\demos\blog_cruge\protected\views\po...", array("index" => 0, "data" => Post, "widget" => CListView), false)

7

+ C:\wamp\www\external\jgb\yii\framework\zii\widgets\CListView.php(260): CBaseController->renderFile("C:\wamp\www\external\jgb\yii\demos\blog_cruge\protected\views\po...", array("index" => 0, "data" => Post, "widget" => CListView))

8

+ C:\wamp\www\external\jgb\yii\framework\zii\widgets\CBaseListView.php(161): CListView->renderItems()

9

unknown(0): CBaseListView->renderSection(array("{items}", "items"))

10

+ C:\wamp\www\external\jgb\yii\framework\zii\widgets\CBaseListView.php(144): preg_replace_callback("/{(\w+)}/", array(CListView, "renderSection"), "{items} {pager}")

11

+ C:\wamp\www\external\jgb\yii\framework\zii\widgets\CBaseListView.php(129): CBaseListView->renderContent()

12

+ C:\wamp\www\external\jgb\yii\framework\web\CBaseController.php(174): CBaseListView->run()

13

+ C:\wamp\www\external\jgb\yii\demos\blog_cruge\protected\views\post\index.php(9): CBaseController->widget("zii.widgets.CListView", array("dataProvider" => CActiveDataProvider, "itemView" => "_view", "template" => "{items} {pager}"))

14

+ C:\wamp\www\external\jgb\yii\framework\web\CBaseController.php(127): require("C:\wamp\www\external\jgb\yii\demos\blog_cruge\protected\views\po...")

15

+ C:\wamp\www\external\jgb\yii\framework\web\CBaseController.php(96): CBaseController->renderInternal("C:\wamp\www\external\jgb\yii\demos\blog_cruge\protected\views\po...", array("dataProvider" => CActiveDataProvider), true)

16

+ C:\wamp\www\external\jgb\yii\framework\web\CController.php(870): CBaseController->renderFile("C:\wamp\www\external\jgb\yii\demos\blog_cruge\protected\views\po...", array("dataProvider" => CActiveDataProvider), true)

17

+ C:\wamp\www\external\jgb\yii\framework\web\CController.php(783): CController->renderPartial("index", array("dataProvider" => CActiveDataProvider), true)

18

+ C:\wamp\www\external\jgb\yii\demos\blog_cruge\protected\controllers\PostController.php(137): CController->render("index", array("dataProvider" => CActiveDataProvider))

19

+ C:\wamp\www\external\jgb\yii\framework\web\actions\CInlineAction.php(50): PostController->actionIndex()

20

+ C:\wamp\www\external\jgb\yii\framework\web\CController.php(309): CInlineAction->runWithParams(array())

21

+ C:\wamp\www\external\jgb\yii\framework\web\filters\CFilterChain.php(134): CController->runAction(CInlineAction)

22

+ C:\wamp\www\external\jgb\yii\framework\web\filters\CFilter.php(41): CFilterChain->run()

23

+ C:\wamp\www\external\jgb\yii\framework\web\CController.php(1146): CFilter->filter(CFilterChain)

24

+ C:\wamp\www\external\jgb\yii\framework\web\filters\CInlineFilter.php(59): CController->filterAccessControl(CFilterChain)

25

+ C:\wamp\www\external\jgb\yii\framework\web\filters\CFilterChain.php(131): CInlineFilter->filter(CFilterChain)

26

+ C:\wamp\www\external\jgb\yii\framework\web\CController.php(292): CFilterChain->run()

27

+ C:\wamp\www\external\jgb\yii\framework\web\CController.php(266): CController->runActionWithFilters(CInlineAction, array("accessControl"))

28

+ C:\wamp\www\external\jgb\yii\framework\web\CWebApplication.php(283): CController->run("")

29

+ C:\wamp\www\external\jgb\yii\framework\web\CWebApplication.php(142): CWebApplication->runController("")

30

+ C:\wamp\www\external\jgb\yii\framework\base\CApplication.php(162): CWebApplication->processRequest()

31

+ C:\wamp\www\external\jgb\yii\demos\blog_cruge\index.php(11): CApplication->run() 2012-12-14 09:03:34 Apache/2.2.21 (Win32) PHP/5.3.10 Yii Framework/1.1.12

[  Yii ver: 1.1.12   ]
[  Memory: 14680.46Kb  ]
[  Time: 0.96  ]
[  DB Query: 15  ]
[  App Log   ]

Yii

Comments (2)

  1. Christian Salazar repo owner

    tratando de "adivinar" puedo ver que estas pasando un array a la descripcion de un authitem...eso no es un error de cruge.

    en el primer stacktrace dice eso: "description" => array("userid" => "1")

    seguramente este es el causante del error, no tiene nada que ver con Cruge.

    C:\wamp\www\external\jgb\yii\demos\blog_cruge\protected\modules\cruge\components\CrugeAuthManager.php(706): CDbCommand->insert("cruge_authitem", array("name" => "PostUpdateOwn", "type" => 0, "description" => array("userid" => "1"), "bizrule" => null, ...)

  2. Log in to comment