PHP warning

Illegal string offset 'mandatory'

C:\etc\Apache\htdocs\MSSQL\application\controllers\admin\tokens.php(998)

0986             'sent' => 'N',
0987             'remindersent' => 'N',
0988             'completed' => 'N',
0989             'usesleft' => Yii::app()->request->getPost('usesleft'),
0990             'validfrom' => Yii::app()->request->getPost('validfrom'),
0991             'validuntil' => Yii::app()->request->getPost('validuntil'));
0992 
0993             // add attributes
0994             $attrfieldnames = getTokenFieldsAndNames($iSurveyId,true);
0995             foreach ($attrfieldnames as $attr_name => $desc)
0996             {
0997                 $value = Yii::app()->request->getPost($attr_name);
0998                 if ($desc['mandatory'] == 'Y' && trim($value) == '')
0999                     $this->getController()->error(sprintf($clang->gT('%s cannot be empty'), $desc['description']));
1000                 $aData[$attr_name] = Yii::app()->request->getPost($attr_name);
1001             }
1002 
1003             $amount = sanitize_int(Yii::app()->request->getPost('amount'));
1004             $tokenlength = sanitize_int(Yii::app()->request->getPost('tokenlen'));
1005 
1006             // Fill an array with all existing tokens
1007             $criteria = Tokens_dynamic::model($iSurveyId)->getDbCriteria();
1008             $criteria->select = 'token';
1009             $ntresult = Tokens_dynamic::model($iSurveyId)->findAllAsArray($criteria);   //Use AsArray to skip active record creation
1010             $existingtokens=array();

Stack Trace

#2
+
 C:\etc\Apache\htdocs\MSSQL\application\core\Survey_Common_Action.php(82): CAction->runWithParamsInternal(tokens, ReflectionMethod, array("surveyid" => "945857", "subaction" => "add", "sa" => "adddummies", "iSurveyId" => "945857", ...))
77             $oMethod = new ReflectionMethod($this, $sDefault);
78         }
79 
80         // We're all good to go, let's execute it
81         // runWithParamsInternal would automatically get the parameters of the method and populate them as required with the params
82         return parent::runWithParamsInternal($this, $oMethod, $params);
83     }
84 
85     /**
86     * Some functions have different parameters, which are just an alias of the
87     * usual parameters we're getting in the url. This function just populates
#6
+
 C:\etc\Apache\htdocs\MSSQL\application\controllers\AdminController.php(159): CController->run("tokens")
154                 Yii::app()->session['redirectopage'] = Yii::app()->request->requestUri;
155 
156                 $this->redirect($this->createUrl('/admin/authentication/login'));
157             }
158 
159             return parent::run($action);
160     }
161 
162     /**
163     * Routes all the actions to their respective places
164     *
#10
+
 C:\etc\Apache\htdocs\MSSQL\index.php(178): CApplication->run()
173  *
174  */
175 require_once BASEPATH . 'yii' . EXT;
176 require_once APPPATH . 'core/LSYii_Application' . EXT;
177 
178 Yii::createApplication('LSYii_Application', APPPATH . 'config/config' . EXT)->run();
179 
180 /* End of file index.php */
181 /* Location: ./index.php */
2012-10-29 13:47:05 Apache/2.4.3 (Win32) OpenSSL/1.0.1c PHP/5.4.7 Yii Framework/1.1.10