View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
04955Bug reportsSurvey participants (Tokens)public2011-04-11 11:30
Reporteruser12158Assigned Toc_schmitz  
PrioritynormalSeveritypartial_block 
Status closedResolutionfixed 
Product Version1.90+ 
Fixed in Version1.91RC6 
Summary04955: GSOC - email invites to a subset of tokens result in emails to random tokens
Description

in my survey i have ~200 tokens. my mail server limits me to 10 emails at a time, which I've set in the global settings of lime survey. if i check ~30 tokens and scroll to the bottom of the tokens page and click on the "invite selected tokens" button it sends the first 10 correctly then pauses and says ~20 emails left, as i would expect. however when clicking on continue it sends another ten emails and says ~180 emails left, ie its now sending to the entire list. upon further inspection the second batch of emails was sent to people i had NOT originally selected. this is not expected behavior

Steps To Reproduce

set email settings to send 10 emails at a time.
create survey with 30+ tokens.
select 15 tokens and click the email invites button.
click send.
you get a message saying there are 5 emails left to send.
after 1 minute (or the appropriate cool down for your mailserver) click continue.

10 MORE emails are sent. there should only be 5. furthermore it should say 0 emails left. instead it lists 10 emails left (all tokens minus the 20 youve sent)

TagsNo tags attached.
Attached Files
04955_debugged_limesurvey_stable.patch (1,265 bytes)   
Index: tokens.php
===================================================================
--- tokens.php	(revision 9887)
+++ tokens.php	(working copy)
@@ -1622,6 +1622,10 @@
             }
             if ($ctcount > $emcount)
             {
+                $i = 0;
+                while($i < $maxemails)
+                { array_shift($tokenids); $i++; }
+                $tids = '|'.implode('|',$tokenids);
                 $lefttosend = $ctcount-$maxemails;
                 $tokenoutput .= "</ul>\n"
                 ."<div class='warningheader'>".$clang->gT("Warning")."</div><br />\n"
@@ -1634,7 +1638,8 @@
                 ."<input type='hidden' name='subaction' value=\"email\" />\n"
                 ."<input type='hidden' name='action' value=\"tokens\" />\n"
                 ."<input type='hidden' name='bypassbademails' value=\"".$_POST['bypassbademails']."\" />\n"
-                ."<input type='hidden' name='sid' value=\"{$surveyid}\" />\n";
+                ."<input type='hidden' name='sid' value=\"{$surveyid}\" />\n"
+                ."<input type='hidden' name='tids' value=\"{$tids}\" />\n";
                 foreach ($surveylangs as $language)
                 {
                     $message = html_escape($_POST['message_'.$language]);
Bug heat6
Complete LimeSurvey version number (& build)9642
I will donate to the project if issue is resolvedNo
Browserchrome
Database type & versionmysql Ver 14.14 Distrib 5.5.8, for Win32 (x86)
Server OS (if known)window server 2003 standard
Webserver software & version (if known)apache 2.2
PHP Version5.3.5

Users monitoring this issue

There are no users monitoring this issue.

Activities

user12158

2011-02-15 17:21

  ~14186

it apears that the variable tokenids in tokens.php gets its value from $tokenids=returnglobal('tids'); // line 32

on line 1384 each email is sent. if successful should the $tokenids/tids be updated?

that seems to be the crux of the problem; when you click on continue tokenids is reset to all tokens.

c_schmitz

c_schmitz

2011-03-29 15:20

administrator   ~14597

Patch looks fine to me. Thank you!

nehiljain

nehiljain

2011-04-01 06:51

reporter   ~14627

Thank you for for consent.

c_schmitz

c_schmitz

2011-04-11 11:30

administrator   ~14753

1.91RC6 released.

Issue History

Date Modified Username Field Change
2011-02-15 07:04 user12158 New Issue
2011-02-15 16:55 Mazi Assigned To => c_schmitz
2011-02-15 16:55 Mazi Status new => assigned
2011-02-15 16:55 Mazi Summary email invites to a subset of tokens result in emails to random tokens => GSOC - email invites to a subset of tokens result in emails to random tokens
2011-02-15 17:21 user12158 Note Added: 14186
2011-03-20 17:19 nehiljain File Added: 04955_debugged_limesurvey_stable.patch
2011-03-29 15:20 c_schmitz Note Added: 14597
2011-03-29 15:20 c_schmitz Status assigned => resolved
2011-03-29 15:20 c_schmitz Fixed in Version => 1.91RC6
2011-03-29 15:20 c_schmitz Resolution open => fixed
2011-04-01 06:51 nehiljain Note Added: 14627
2011-04-11 11:30 c_schmitz Note Added: 14753
2011-04-11 11:30 c_schmitz Status resolved => closed
2016-12-08 10:39 c_schmitz Category Tokens => Survey participants (Tokens)