View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
04280Bug reportsOtherpublic2010-08-04 16:20
Reporteruser7616Assigned To 
PrioritynormalSeverityminor 
Status closedResolutionunable to reproduce 
Product Version1.87+ 
Summary04280: wrong additional language list
Description

When you have a servey with additional languages and you remove them through an edit, you will get the PHP error "Warning: array_map() [function.array-map]: Argument #2 should be an array in [...]\admin\html.php on line 2749"

When you launch the servey (e.g. through the mainpage list) you will get the additional language box even if only the base language is defined. Also you will get the base survey listed for every language.

Steps To Reproduce
  1. Create or edit a survey
  2. Set an additional language and save it
  3. Edit again and remove the additional language. The list has to be empty. Save it again
  4. You will see the PHP error
Additional Information

We use MSSQL (dunno if it happens with other database engines too) and the field "additional languages" as a content of length 0.
The error is in GetAdditionalLanguagesFromSurveyID() (common.php line 3358). The Query will list you an result with an content length of 1 for "additional language". To fix the problem, you habe to move the trim() in line 3366 to line 3365. [$surveylanguage = $row[0] to $surveylanguage = trim($row[0])]

TagsNo tags attached.
Bug heat6
Complete LimeSurvey version number (& build)8518
I will donate to the project if issue is resolved
Browser
Database type & versionMSSQL 2008
Server OS (if known)Windows Server 2003
Webserver software & version (if known)IIS
PHP Version5.1.4

Users monitoring this issue

There are no users monitoring this issue.

Activities

user7616

2010-04-15 15:16

  ~11616

It would be better to set the column to NULL if no additional language available. I just recognized, that you will still see the survey in the base language. doesn't matter which language you selected

Mazi

Mazi

2010-05-12 00:02

updater   ~11769

I can't reproduce the problem neither on the latest 1.90beta nor at version 1.87 build 8518.

Can you attach a sample survey containing the two languages? If I got you right, fanste, importing the survey and deleting the additional language should reproduce the error?

user7616

2010-05-12 08:25

  ~11784

Currently I'm not in the company (internal server). I just tried to reproduce the error on the local machine mit MySQL, but there i also don't get this error anymore (Maybe the error-settings are different). But the effect is still the same: You will still see the survey in the base language (mainpage) when you select a language from the dropdown thats not the base one. Normaly you should get an error message (For german: "Es gibt leider keine passende Umfrage.")

Maybe I have the time to test it in the company again. The exact way to reproduce it was:

  • Create a complete new survey.
  • After that create a additional language
  • Delete this additonal language again (list has to be empty)
  • You will receive an error because PHP reads the additional-language-field from the database with a length of 1 (instead of 0) and so explode() creates an empty entry in the array - what means: there is one additional language.
Mazi

Mazi

2010-05-19 13:26

updater   ~11867

Please do some further testing and report back if this issue still needs to be solved.

Thanks!

Mazi

Mazi

2010-05-26 13:49

updater   ~11958

Feedback?

user7616

2010-05-26 20:29

  ~11986

Sorry, I forgot to answer.

I am currently not able to test it on the machine (IIS, MSSQL,...) where the error occures, because I am not in the company (studying atm).

I will test it again and send you some feedback as soon as possible.

Mazi

Mazi

2010-07-13 02:27

updater   ~12401

Please provide some feedback or we'll have to close this ticket.

c_schmitz

c_schmitz

2010-08-04 16:20

administrator   ~12551

Unable to reproduce. Closing due to missing feedback.

Issue History

Date Modified Username Field Change
2010-04-15 15:02 user7616 New Issue
2010-04-15 15:02 user7616 Status new => assigned
2010-04-15 15:02 user7616 Assigned To => user372
2010-04-15 15:16 user7616 Note Added: 11616
2010-05-12 00:02 Mazi Note Added: 11769
2010-05-12 00:02 Mazi Assigned To user372 => Mazi
2010-05-12 00:02 Mazi Status assigned => feedback
2010-05-12 08:25 user7616 Note Added: 11784
2010-05-12 08:25 user7616 Status feedback => assigned
2010-05-19 13:26 Mazi Note Added: 11867
2010-05-19 13:26 Mazi Status assigned => feedback
2010-05-26 13:49 Mazi Note Added: 11958
2010-05-26 20:29 user7616 Note Added: 11986
2010-05-26 20:29 user7616 Status feedback => assigned
2010-06-01 16:04 Mazi Status assigned => feedback
2010-07-13 02:27 Mazi Note Added: 12401
2010-08-04 16:10 c_schmitz Assigned To Mazi => c_schmitz
2010-08-04 16:10 c_schmitz Status feedback => assigned
2010-08-04 16:20 c_schmitz Note Added: 12551
2010-08-04 16:20 c_schmitz Status assigned => closed
2010-08-04 16:20 c_schmitz Assigned To c_schmitz =>
2010-08-04 16:20 c_schmitz Resolution open => unable to reproduce
2010-10-25 00:21 c_schmitz Category Data Access => (No Category)