View Issue Details

This issue affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
08789Bug reportsSurvey takingpublic2014-03-02 16:34
Reportermfaber Assigned Toc_schmitz  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version2.05+ 
Summary08789: PHP warning trim() expects parameter 1 to be string, array given
Description

PHP warning

trim() expects parameter 1 to be string, array given
E:\survey\htdocs\github\LimeSurvey\application\helpers\qanda_helper.php(3385)

3373 }
3374 if (intval(trim($aQuestionAttributes['maximum_chars']))>0 && intval(trim($aQuestionAttributes['maximum_chars']))<20)
3375 {
3376 // Only maxlength attribute, use textarea[maxlength] jquery selector for textarea
3377 $maximum_chars= intval(trim($aQuestionAttributes['maximum_chars']));
3378 $maxlength= " maxlength='{$maximum_chars}' ";
3379 $extraclass .=" maxchars maxchars-".$maximum_chars;
3380 }
3381 else
3382 {
3383 $maxlength= " maxlength='20' ";
3384 }
3385 if (trim($aQuestionAttributes['text_input_width'])!='')
3386 {
3387 $tiwidth=$aQuestionAttributes['text_input_width'];
3388 $extraclass .=" inputwidth-".trim($aQuestionAttributes['text_input_width']);
3389 }
3390 else
3391 {
3392 $tiwidth=10;
3393 }
3394
3395 if (trim($aQuestionAttributes['num_value_int_only'])==1)
3396 {
3397 $acomma="";

Steps To Reproduce

after pushing button to test a survey

TagsNo tags attached.
Attached Files
array_string.lss (18,520 bytes)
Bug heat4
Complete LimeSurvey version number (& build)20140301
I will donate to the project if issue is resolvedNo
BrowserFF
Database type & versionMySQL 5.0.10
Server OS (if known)Win7
Webserver software & version (if known)Apache/2.4.4 (Win32)
PHP VersionPhP 5.4.19
Git branch / Pull Request URL

Users monitoring this issue

There are no users monitoring this issue.

Activities

c_schmitz

c_schmitz

2014-03-01 22:26

administrator   ~29030

Please attach the survey.

mfaber

mfaber

2014-03-02 00:56

reporter   ~29031

I think the problem are some q-attribs that are falsely i8n.
e.g. field length.

mfaber

mfaber

2014-03-02 00:59

reporter   ~29032

I also get a warning when choosing the second question in the question group.

PHP warning

Illegal offset type

E:\survey\htdocs\github\LimeSurvey\application\core\Survey_Common_Action.php(421)

409 $aData['gid'] = $gid;
410 $aData['clang'] = $clang;
411 $aData['qrrow'] = $qrrow;
412 $aData['baselang'] = $baselang;
413 $aAttributesWithValues = Question::model()->getAdvancedSettingsWithValues($qid, $qrrow['type'], $iSurveyID, $baselang);
414 $DisplayArray = array();
415 foreach ($aAttributesWithValues as $aAttribute)
416 {
417 if (($aAttribute['i18n'] == false && isset($aAttribute['value']) && $aAttribute['value'] != $aAttribute['default']) || ($aAttribute['i18n'] == true && isset($aAttribute['value'][$baselang]) && $aAttribute['value'][$baselang] != $aAttribute['default']))
418 {
419 if ($aAttribute['inputtype'] == 'singleselect')
420 {
421 $aAttribute['value'] = $aAttribute['options'][$aAttribute['value']];
422 }
423 /
424 if ($aAttribute['name']=='relevance')
425 {
426 $sRelevance = $aAttribute['value'];
427 if ($sRelevance !== '' && $sRelevance !== '1' && $sRelevance !== '0')
428 {
429 LimeExpressionManager::ProcessString("{" . $sRelevance . "}"); // tests Relevance equation so can pretty-print it
430 $aAttribute['value']= LimeExpressionManager::GetLastPrettyPrintExpression();
431 }
432 }
433
/

c_schmitz

c_schmitz

2014-03-02 09:49

administrator   ~29035

Last edited: 2014-03-02 09:54

Question is how you managed to create this attribute. It is not possible using the GUI.

mfaber

mfaber

2014-03-02 16:34

reporter   ~29060

I had this survey on my system for quite some time....so maybe this is the result of a bug which has long been solved...
Thanks for having a look --> close

Issue History

Date Modified Username Field Change
2014-03-01 19:09 mfaber New Issue
2014-03-01 22:26 c_schmitz Note Added: 29030
2014-03-01 22:26 c_schmitz Assigned To => c_schmitz
2014-03-01 22:26 c_schmitz Status new => feedback
2014-03-02 00:54 mfaber File Added: array_string.lss
2014-03-02 00:56 mfaber Note Added: 29031
2014-03-02 00:56 mfaber Status feedback => assigned
2014-03-02 00:59 mfaber Note Added: 29032
2014-03-02 09:49 c_schmitz Note Added: 29035
2014-03-02 09:54 c_schmitz Note Edited: 29035
2014-03-02 16:34 mfaber Note Added: 29060
2014-03-02 16:34 mfaber Status assigned => closed
2014-03-02 16:34 mfaber Resolution open => fixed