CDbException

CDbCommand failed to execute the SQL statement: SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for integer: "survey"
LINE 1: ...FROM "lime_permissions" "t" WHERE "t"."entity_id"='survey' A...
^. The SQL statement executed was: SELECT * FROM "lime_permissions" "t" WHERE "t"."entity_id"=:yp0 AND "t"."uid"=:yp1 AND "t"."entity"=:yp2 AND "t"."permission"=:yp3 LIMIT 1. Bound with :yp0='survey', :yp1='50', :yp2='369689', :yp3='surveyactivation'

/usr/share/nginx/html/lsurveymaster/framework/db/CDbCommand.php(543)

531         {
532             if($this->_connection->enableProfiling)
533                 Yii::endProfile('system.db.CDbCommand.query('.$this->getText().$par.')','system.db.CDbCommand.query');
534 
535             $errorInfo=$e instanceof PDOException ? $e->errorInfo : null;
536             $message=$e->getMessage();
537             Yii::log(Yii::t('yii','CDbCommand::{method}() failed: {error}. The SQL statement executed was: {sql}.',
538                 array('{method}'=>$method, '{error}'=>$message, '{sql}'=>$this->getText().$par)),CLogger::LEVEL_ERROR,'system.db.CDbCommand');
539 
540             if(YII_DEBUG)
541                 $message.='. The SQL statement executed was: '.$this->getText().$par;
542 
543             throw new CDbException(Yii::t('yii','CDbCommand failed to execute the SQL statement: {error}',
544                 array('{error}'=>$message)),(int)$e->getCode(),$errorInfo);
545         }
546     }
547 
548     /**
549      * Builds a SQL SELECT statement from the given query specification.
550      * @param array $query the query specification in name-value pairs. The following
551      * query options are supported: {@link select}, {@link distinct}, {@link from},
552      * {@link where}, {@link join}, {@link group}, {@link having}, {@link order},
553      * {@link limit}, {@link offset} and {@link union}.
554      * @throws CDbException if "from" key is not present in given query parameter
555      * @return string the SQL statement

Stack Trace

#2
+
 /usr/share/nginx/html/lsurveymaster/application/models/LSActiveRecord.php(67): CActiveRecord->query(CDbCriteria, false)
62      */
63     protected function query($criteria, $all = false, $asAR = true)
64     {
65         if ($asAR === true)
66         {
67             return parent::query($criteria, $all);
68         } else
69         {
70             $this->beforeFind();
71             $this->applyScopes($criteria);
72             if (!$all)
#4
+
 /usr/share/nginx/html/lsurveymaster/application/models/Permission.php(504): CActiveRecord->findByAttributes(array("entity_id" => "survey", "uid" => "50", "entity" => "369689", "permission" => "surveyactivation"))
499         }
500         
501         if ($aPermissionCache[0]['global'][$iUserID]['superadmin']['read_p']) return true;
502         if (!isset($aPermissionCache[$iEntityID][$sEntityName][$iUserID][$sPermission][$sCRUD]))
503         {
504             $query = $this->findByAttributes(array("entity_id"=> $iEntityID, "uid"=> $iUserID, "entity"=>$sEntityName, "permission"=>$sPermission));
505             $bPermission = is_null($query) ? array() : $query->attributes;
506             if (!isset($bPermission[$sCRUD]) || $bPermission[$sCRUD]==0)
507             {
508                 $bPermission=false;
509             }
#5
+
 /usr/share/nginx/html/lsurveymaster/application/controllers/admin/surveypermission.php(456): Permission->hasPermission("survey", "369689", "surveyactivation", "update", ...)
451                         if (!($sPermissionKey=='survey' && $sCRUDKey=='read'))
452                         {
453                             $usersummary .= "<input type=\"checkbox\"  class=\"checkboxbtn\" name='perm_{$sPermissionKey}_{$sCRUDKey}' ";
454                             if($action=='setsurveysecurity')
455                             {
456                                 if(Permission::model()->hasPermission('survey',$surveyid,$sPermissionKey,$sCRUDKey,$postuserid))
457                                 {
458                                     $usersummary .= ' checked="checked" ';// User have this permission set for this survey
459 
460                                 }
461                                 elseif(Permission::model()->hasSurveyPermission( $surveyid,$sPermissionKey,$sCRUDKey,$postuserid))
2015-04-16 00:36:41 nginx/1.4.6 Yii Framework/1.1.15