View Issue Details

This bug affects 1 person(s).
 10
IDProjectCategoryView StatusLast Update
05093Bug reportsStatisticspublic2011-04-11 11:30
Reportersmarthbehl Assigned Toc_schmitz  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version1.91RC5 
Fixed in Version1.91RC6 
Summary05093: Statistics Page error
Description

When I try to view the public statistics of the survey which is listed publically
by clicking on view statistics page on index page
I get the following warning message
Warning: Invalid argument supplied for foreach() in C:\wamp\www\lime\statistics_user.php on line 258

Steps To Reproduce
  1. Import the sample survey LimeSurvey 1.80 All Questions with most options from docs folder
  2. Go to survey settings and make public statistics available
  3. When you click on view statistics you get the warning message

Warning: Invalid argument supplied for foreach() in C:\wamp\www\lime\statistics_user.php on line 258

TagsNo tags attached.
Attached Files
statistics_user.php (16,000 bytes)
Bug heat10
Complete LimeSurvey version number (& build)9907
I will donate to the project if issue is resolvedNo
BrowserFirefox 3.6
Database type & versionMySQL 5.1.36
Server OS (if known)VISTA Professional
Webserver software & version (if known)WAMP 2.0
PHP Version5.2.6

Users monitoring this issue

There are no users monitoring this issue.

Activities

c_schmitz

c_schmitz

2011-04-06 23:37

administrator   ~14712

Smarth, can you provide a fix, too?

user13267

2011-04-07 03:02

  ~14714

I was unable to reproduce this problem.

mdekker

mdekker

2011-04-07 14:38

reporter   ~14722

Happens when no field is set to be available in public statistics (to me)

smarthbehl

smarthbehl

2011-04-07 15:19

reporter   ~14726

I have attached the file with the fix.The error was caused when variable filters was not set because query returned no results(if there are no questions with public statistics attribute set to 1 but public statistics are available for survey).I just used isset to check if variable is set before executing the loop.
Carsten Please check the fix and let me know

mdekker

mdekker

2011-04-07 16:05

reporter   ~14728

Could you please provide a svn diff file? Also, when there are no fields defined it would be nice to display an error message to the user so the admin knows he should make some fields available. Ofcourse the message should be translated to the right language.

DenisChenu

DenisChenu

2011-04-07 18:49

developer   ~14733

<quote>when there are no fields defined</quote>

ANd if there are no field defined, mayabe the link doesn't had to be appear to public at all.

:)

c_schmitz

c_schmitz

2011-04-11 11:30

administrator   ~14742

1.91RC6 released.

Issue History

Date Modified Username Field Change
2011-04-06 22:54 smarthbehl New Issue
2011-04-06 23:37 c_schmitz Note Added: 14712
2011-04-07 03:02 user13267 Note Added: 14714
2011-04-07 14:38 mdekker Note Added: 14722
2011-04-07 15:15 smarthbehl File Added: statistics_user.php
2011-04-07 15:19 smarthbehl Note Added: 14726
2011-04-07 16:05 mdekker Note Added: 14728
2011-04-07 18:49 DenisChenu Note Added: 14733
2011-04-11 00:09 c_schmitz Status new => resolved
2011-04-11 00:09 c_schmitz Fixed in Version => 1.91RC6
2011-04-11 00:09 c_schmitz Resolution open => fixed
2011-04-11 00:09 c_schmitz Assigned To => c_schmitz
2011-04-11 11:30 c_schmitz Note Added: 14742
2011-04-11 11:30 c_schmitz Status resolved => closed