View Issue Details

This issue affects 1 person(s).
 2
IDProjectCategoryView StatusLast Update
05682Bug reportsSurvey participants (Tokens)public2012-03-11 16:35
Reporteruser16774Assigned Touser16774 
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version2.00a1 
Fixed in Version2.00a2 
Summary05682: 500 attempting to export tokens
Description

Trying to export tokens from the token manager causes a 500 error when no tokens exist.

Invalid argument supplied for foreach()
/limesurvey/lime/application/views/admin/token/exportdialog.php(27)

TagsNo tags attached.
Attached Files
textfile1.patch (755 bytes)   
Index: application/views/admin/token/exportdialog.php
===================================================================
--- application/views/admin/token/exportdialog.php	(revision 12308)
+++ application/views/admin/token/exportdialog.php	(working copy)
@@ -23,10 +23,12 @@
             </select></li>
         <li><label for='tokenlanguage' ><?php $clang->eT('Filter by language'); ?></label><select id='tokenlanguage' name='tokenlanguage' >
                 <option selected='selected' value=''><?php $clang->eT('All'); ?></option>
-<?php
+<?php
+if($resultr){
 foreach ($resultr as $lrow)
 {
     echo "<option value='{$lrow['language']}'>" . getLanguageNameFromCode($lrow['language']) . "</option>";
+}
 }
 ?>
             </select></li>
textfile1.patch (755 bytes)   
Bug heat2
Complete LimeSurvey version number (& build)12135
I will donate to the project if issue is resolvedNo
Browser
Database type & versionMySQL 5.1.58
Server OS (if known)Ubuntu Linux
Webserver software & version (if known)Apache 2.2.20
PHP VersionPHP 5.3.6-13
Git branch / Pull Request URL

Users monitoring this issue

There are no users monitoring this issue.

Activities

user16774

2012-02-05 11:11

  ~17228

Although this patch fixes the 500, the resulting file is not a valid csv file. This needs resolved.

Instead, it should output a csv file with a single header row when there are no tokens.

user16774

2012-02-10 07:52

  ~17350

Fixed additional issue where CSV files from token export were wrapped in HTML.

Issue History

Date Modified Username Field Change
2012-01-21 15:45 user16774 New Issue
2012-01-21 15:45 user16774 Status new => assigned
2012-01-21 15:45 user16774 Assigned To => ShellZero
2012-02-02 18:25 ShellZero File Added: textfile1.patch
2012-02-02 18:31 ShellZero File Deleted: textfile1.patch
2012-02-02 19:19 ShellZero File Added: textfile1.patch
2012-02-05 11:11 user16774 Note Added: 17228
2012-02-10 07:31 user16774 Assigned To ShellZero => user16774
2012-02-10 07:52 user16774 Note Added: 17350
2012-02-10 07:52 user16774 Status assigned => resolved
2012-02-10 07:52 user16774 Fixed in Version => 2.00a1
2012-02-10 07:52 user16774 Resolution open => fixed
2012-03-11 16:35 c_schmitz Status resolved => closed
2012-03-11 16:35 c_schmitz Fixed in Version 2.00a1 => 2.00a2
2016-12-08 10:39 c_schmitz Category Tokens => Survey participants (Tokens)