View Issue Details

This bug affects 1 person(s).
IDProjectCategoryView StatusLast Update
07531Feature requestsSurvey participants (Tokens)public2013-03-12 14:35
ReporterJEfromCanada Assigned To 
Status acknowledgedResolutionopen 
Summary07531: To alleviate the problems caused by survey URL's split by email program

If Lime Survey is installed in such a way that the root url for the survey is a long character string, the generated SURVEYURL may be longer than the line size of the email program.

This results in the email program splitting the survey link over multiple lines, and in many email programs, these split URL's no longer function (i.e. the portion of the URL that does not fit on the first line is visible, but no longer part of the actual URL). Clicking on such a broken link will lead to a failed attempt to access the survey, frustrating the invitee.

Additional Information

A possible solution: Add a new variable SHORTSURVEYURL which can be used as the invitation link
I propose that one or more of the commonly used URL shortening services be contacted to determine if they have an API that would allow Lime Survey (or Lime Service) to call the URL shortening service with the value of SURVEYURL and return with a value which would be stored in SHORTSURVEYURL.

The user would have the option of using the SHORTSURVEYURL in email templates to guarantee that survey urls generated by Lime Survey would be shorter than the "typical" line size of an email program.

After initially posting this idea, I came across an existing API for the tinyurl service. Rather than repeating the code here, I will reference the page where it can be found...

The fact that this API already exists means that Lime Survey does not need to search for a URL shortening API!

TagsNo tags attached.
Bug heat4
Story point estimate
Users affected %

Users monitoring this issue

User List There are no users monitoring this issue.




2011-11-30 07:55

reporter   ~24386

Immediately after posting this suggestion, I came across an existing API for the tinyurl service. Rather than repeating the code here, I will reference the page where it can be found...


2011-11-30 12:46


Addition to Solution 1:
It would be nice if the value of SHORTSURVEYURL could also be displayed on the survey overview page under "Survey URL" or (if no short survey url exists) a link/button for creating a short url for the survey.



2011-12-02 06:22

reporter   ~24388

With respect for the good ideas of vierundzwanzig, it doesn't make sense to display the SHORTSURVEYURL on the overview page as suggested; because the SHORTSURVEYURL should be generated from the complete URL, including the "token=xxxx" clause specific to a particular invitation.

The Survey URL (lang) shown on the survey overview page is only a partial URL (it doesn't contain the "token=xxxx" portion of the complete URL), and is not equivalent to the string substitution variable SURVEYURL.

Since tinyurl will be used to compress the entire URL (including the "token=xxxx" clause), any short URL generated without this information will be meaningless.



2011-12-02 22:28

reporter   ~24389

Using build 11379 as a starting point, I have written all the code necessary to implement this idea. I just need to create the "deltas" for the updated modules so it can be easily submitted to LimeSurvey for inclusion/testing.

The modules affected are as follows:

common_functions.php - add new function getshorturl

fck_LimeReplacementFields.php - added new items to dropdown list of available user substitution variables

register.php, tokens.php, - added code to each module to define the replacement strings for new tokens:

The only thing I did not do is to check whether there is a translation function change needed to make the new UI strings:

"Short URL of the survey" and
"Short URL for a respondent to opt-out this survey"
available in a language other than English.



2011-12-03 10:38

reporter   ~24390

Now that I've upgraded my installation to the latest build, I've been able to test my code. There are errors in the HTML generated tokens (stupid mistake) which I am working on correcting.

I'll post an updated zip file when I've fixed the problem.



2011-12-03 18:53

reporter   ~24391

Errors have all been corrected and the feature works perfectly. I will be uploading the code change for hopeful inclusion in the trunk.



2011-12-03 19:27

reporter   ~24392

I have uploaded a zipfile containing the patched programs that implement the current idea. You can find them here:

If someone on the development team wishes to verify that this patch works, maybe you would consider adding it to the trunk.

(I also corrected an error in line 159 of the original register.php file - the "?" was missing between the "optout.php" module name and the first input parameter).


2011-12-05 09:07


If you don't use tokens (e.g. for an anonymous survey) it makes sense. Perhaps a new variable like SHORTURLENTIRESURVEY that just shortens the general survey url (e.g. http://localhost/limesurvey/index.php?sid=28815&lang=de) will help to solve this problem.



2011-12-06 11:09

reporter   ~24394

Last edited: 2013-03-12 14:35

I've created a user patch in the bug tracker system:


Issue History

Date Modified Username Field Change
2013-03-12 14:35 c_schmitz Note Edited: 24394
2016-12-08 10:39 c_schmitz Category Tokens => Survey participants (Tokens)