View Issue Details

This bug affects 1 person(s).
IDProjectCategoryView StatusLast Update
08629Bug reportsSurvey editingpublic2014-02-12 21:20
Reportertpartner Assigned Tosammousa  
Status closedResolutionfixed 
Product Version2.05+ 
Target Version2.05+ 
Summary08629: The template.js file is now placed in the <body> element instead of the <head> element.

Why is this so? If I put the {TEMPLATEJS} tag in the head element I expect the JS files to be inserted there, not somewhere else.

TagsNo tags attached.
Bug heat10
Complete LimeSurvey version number (& build)81b8f55bea7888d37c2490b60fa7
I will donate to the project if issue is resolvedNo
Database type & versionN/A
Server OS (if known)N/A
Webserver software & version (if known)N/A
PHP VersionN/A

Users monitoring this issue





2014-01-30 08:56

developer   ~28269

Last edited: 2014-01-30 08:59

Hi Tony,

It's to be sure to have template.js after all other js file.
The user can replace "included LimeSurvey" function with template.js.

Since we use Yii->registerScriptFile, default behaviour put template.js before question specific js. Then there are no ability to replace easily included js function.
For example, in citronade, before this fix: template.js don't deactivate navbuttonsJqueryUi function.

You see my bug report here:

Before this bug : template.js are at end of body: the user can't use own function in question text.

History: : this fix put template.js before 'question.js' and survey-runtime.js. This disallow user to replace default function (and file). : put template.js after body : bad idea ....

I think template.js must be the last js file readed after all default js file. Maybe another idea ?

First bug report :



2014-01-30 12:45

partner   ~28280

I have read the history and reasons for this but I don't think we should be arbitrarily deciding for the template developer where the best place for the file is.

There are widely varying opinions as to where the best positions for JS files are.

When you say "Before this bug : template.js are at end of body", that is only true for 2.05. In 2.0 the template.js file was placed where the {TEMPLATEJS} was used.

I consider this "feature" to be a regression that removes even more control from template developers.



2014-02-03 16:29

administrator   ~28459

Topic for meeting.



2014-02-04 19:20

reporter   ~28521

Fix committed to master branch:;id=13844



2014-02-12 21:20

administrator   ~28689

2.05+ Build 140212 released

Related Changesets

LimeSurvey: master e5d32ccb

2014-02-04 18:20:23


Details Diff
Fixed issue 08629: The template.js file is now placed in the <body>
element instead of the <head> element.
Affected Issues
mod - application/controllers/survey/index.php Diff File
mod - application/helpers/replacements_helper.php Diff File
mod - application/views/surveys/publicSurveyList.php Diff File

Issue History

Date Modified Username Field Change
2014-01-30 01:03 tpartner New Issue
2014-01-30 08:56 DenisChenu Note Added: 28269
2014-01-30 08:59 DenisChenu Note Edited: 28269
2014-01-30 09:00 DenisChenu Issue Monitored: DenisChenu
2014-01-30 12:45 tpartner Note Added: 28280
2014-02-03 16:29 c_schmitz Note Added: 28459
2014-02-04 14:19 c_schmitz Assigned To => sammousa
2014-02-04 14:19 c_schmitz Status new => assigned
2014-02-04 19:20 sammousa Changeset attached => LimeSurvey master e5d32ccb
2014-02-04 19:20 sammousa Note Added: 28521
2014-02-04 19:20 sammousa Resolution open => fixed
2014-02-04 19:24 sammousa Status assigned => resolved
2014-02-12 21:20 c_schmitz Note Added: 28689
2014-02-12 21:20 c_schmitz Status resolved => closed
2019-11-01 17:25 c_schmitz Category Survey design => Survey editing
2021-08-06 22:42 guest Bug heat 8 => 10