View Issue Details

This bug affects 1 person(s).
 10
IDProjectCategoryView StatusLast Update
08629Bug reportsSurvey editingpublic2014-02-12 21:20
Reportertpartner Assigned Tosammousa  
PrioritynormalSeverityminor 
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.
Description

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
BrowserN/A
Database type & versionN/A
Server OS (if known)N/A
Webserver software & version (if known)N/A
PHP VersionN/A

Users monitoring this issue

DenisChenu

Activities

DenisChenu

DenisChenu

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:
http://bugs.limesurvey.org/view.php?id=8260

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

History:
https://github.com/LimeSurvey/LimeSurvey/commit/e0689febb7f1d38a56eb4f4d41e7dd48363931cf#diff-45373d85e44b13c1ce92b462cc51f001R197 : this fix put template.js before 'question.js' and survey-runtime.js. This disallow user to replace default function (and file).
https://github.com/LimeSurvey/LimeSurvey/commit/e90c89b7a597cc346d4bc748e01630a5a935ae8a#diff-45373d85e44b13c1ce92b462cc51f001R201 : 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 : http://bugs.limesurvey.org/view.php?id=8001
Denis

tpartner

tpartner

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.

c_schmitz

c_schmitz

2014-02-03 16:29

administrator   ~28459

Topic for meeting.

sammousa

sammousa

2014-02-04 19:20

reporter   ~28521

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

c_schmitz

c_schmitz

2014-02-12 21:20

administrator   ~28689

2.05+ Build 140212 released

Related Changesets

LimeSurvey: master e5d32ccb

2014-02-04 18:20:23

sammousa

Details Diff
Fixed issue 08629: The template.js file is now placed in the <body>
element instead of the <head> element.
Affected Issues
08629
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