View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
10871Bug reportsSurvey participants (Tokens)public2016-04-07 23:55
Reporterakeyser Assigned Toollehar  
PriorityimmediateSeveritycrash 
Status closedResolutionfixed 
Product Version2.50.x 
Fixed in Version2.50.x 
Summary10871: Invitation/Reminder buttons at bottom of token table do not function
Description

Invitation/Reminder buttons at bottom of token table do not function.

Steps To Reproduce
  1. Browse to Token management
  2. Select some tokens
  3. Click Invite button (or Reminder button)

-- Expected behaviour
Open an invitation dialog

-- Actual behaviour
A new window/tab is opened to the root of the LimeSurvey app, with the following as GET arguments:

tokenids=2%7C1 (which is a vertical bar separated list of tokens that I had selected: 2|1 )

Additional Information

It appears that the code in scripts/admin/tokens.js, starting at line 338 and 363, are not functioning properly. I've done some debugging and have not yet been able to resolve the issue myself. It's not immediately clear if this is supposed to open in a dialog within the same window, or open a new tab; as it sits, it's opening a new tab without the correct URL.

This is a workflow-breaking bug.

TagsNo tags attached.
Bug heat6
Complete LimeSurvey version number (& build)160404
I will donate to the project if issue is resolvedNo
BrowserGoogle Chrome 49
Database type & versionMySQL 5.6.27-log
Server OS (if known)Windows Server 2008 R2
Webserver software & version (if known)IIS 7.5
PHP Version5.6.14

Users monitoring this issue

There are no users monitoring this issue.

Activities

akeyser

akeyser

2016-04-05 19:10

reporter   ~37015

I've found the cause of this bug.

On an IIS server, that does not support mod_rewrite, the JS variable for the form method (inviteurl, line 351 of tokens.js) ends up contianing something like this:

index.php?r=admin/tokens/sa/email/action/invite/surveyid/12345

This is not a valid form action. Any time a question mark is entered into a form's action attribute, the browser interprets it as a completely cleared query parameter, which ends up calling the root of the application.

Test case showing this:

http://home.turbogfx.net/test-form.php

How can this be fixed for IIS users?

akeyser

akeyser

2016-04-05 19:38

reporter   ~37016

Looking at older versions of LimeSurvey (2.06+) where this functionality was working, I noted one major difference:

The form generated when the Invite/Reminder buttons were clicked specified the method as "POST". LimeSurvey 2.5 160404 currently does not list any method at all, defaulting it to GET. POSTing to a form action that is a GET query itself is supported and works properly, so the fix for this is to add the following to scripts/admin/tokens.js, below line 351 and 376:

                    'method': 'POST',
ollehar

ollehar

2016-04-06 11:04

administrator   ~37023

Changing it to POST does not work for me, since I get this error:

The CSRF token could not be verified.

akeyser

akeyser

2016-04-06 16:04

reporter   ~37041

Yes, I also figured this out:

You must add this code (from LS 2.06+) back for each jQuery-created form, as well:

.append(jQuery('<input>', {
'name': 'YII_CSRF_TOKEN',
'value': LS.data.csrfToken,
'type': 'hidden'
}))

ollehar

ollehar

2016-04-07 14:39

administrator   ~37079

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&amp;id=18377

ollehar

ollehar

2016-04-07 14:39

administrator   ~37080

Thanks for your help!

c_schmitz

c_schmitz

2016-04-07 23:55

administrator   ~37105

Version 2.50 Build 160407 released

Related Changesets

LimeSurvey: master 4f4264ae

2016-04-07 12:39:16

ollehar

Details Diff
Fixed issue 10871: Invitation/Reminder buttons at bottom of token table do not function Affected Issues
10871
mod - scripts/admin/tokens.js Diff File

Issue History

Date Modified Username Field Change
2016-04-05 18:32 akeyser New Issue
2016-04-05 19:10 akeyser Note Added: 37015
2016-04-05 19:38 akeyser Note Added: 37016
2016-04-06 10:56 ollehar Assigned To => ollehar
2016-04-06 10:56 ollehar Status new => assigned
2016-04-06 11:04 ollehar Note Added: 37023
2016-04-06 16:04 akeyser Note Added: 37041
2016-04-07 14:23 c_schmitz Priority none => immediate
2016-04-07 14:23 c_schmitz Severity partial_block => crash
2016-04-07 14:39 ollehar Changeset attached => LimeSurvey master 4f4264ae
2016-04-07 14:39 ollehar Note Added: 37079
2016-04-07 14:39 ollehar Resolution open => fixed
2016-04-07 14:39 ollehar Note Added: 37080
2016-04-07 14:39 ollehar Status assigned => resolved
2016-04-07 14:39 ollehar Fixed in Version => 2.5
2016-04-07 23:55 c_schmitz Note Added: 37105
2016-04-07 23:55 c_schmitz Status resolved => closed
2016-12-08 10:39 c_schmitz Category Tokens => Survey participants (Tokens)