View Issue Details

This issue affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
14999Bug reportsTheme editorpublic2026-01-12 11:15
ReporterDenisChenu Assigned Toc_schmitz  
PrioritynoneSeverityminor 
Status assignedResolutionopen 
Product Version3.17.x 
Summary14999: Unable to unregister or replace script file
Description

I try to work on an alternative JS solution on multiple checkbox with comment.
But i can't unregister the default script

Steps To Reproduce

Add {{ unregisterScriptFile( getConfig('generalscripts') ~ "multiplechoice_withcomments.js") }} at end of layout_global.twig
Create a multiple checkbox with comment : test, script still get loaded

Additional Information

And since script is loaded in qanda : can not be replaced

Current solution : adding this at end of layout_global

            <script>
                var doMultipleChoiceWithComments = function(qID,when) {  console.warn([qID,when]); };
            </script>

But since there are an unregisterScriptFile function, i think it muts unregister the script file
There are a lack of $position in unregisterScriptFile

TagsNo tags attached.
Bug heat4
Complete LimeSurvey version number (& build)6
I will donate to the project if issue is resolvedNo
Browsernot relevant
Database type & versionnot relevant
Server OS (if known)not relevant
Webserver software & version (if known)not relevant
PHP Versionnot relevant

Users monitoring this issue

There are no users monitoring this issue.

Activities

DenisChenu

DenisChenu

2019-06-24 09:58

developer   ~52493

There are some other issue in Multiple choice with comments html produced

  1. No html information (data-XX for example) about checkbox checked when comment or not (the 2 em_tip have .em_commented_checkbox class only)
  2. No html information about the script is active or not.

Can be fixed extend question answers.twig file, but think I think it's better to have it in core.

c_schmitz

c_schmitz

2025-11-19 18:05

administrator   ~83853

I think this is not a issue anymore since you theoretically can use question themes. Correct?

DenisChenu

DenisChenu

2025-11-20 08:26

developer   ~83862

Some question update solution (all with PHP script) can not use question theme.

I think it can be great if we have : Plugin adding question theme in such situation (see this forum post : https://forums.limesurvey.org/forum/plugins/159039-adaptive-maxdiff-plugin-for-limesurvey-6-experimental ) ?

  1. I have to check again if it's still an issue (for plugin)
  2. I have to check the otherb There are some other issue in Multiple choice with comments html produced to be reported separatly.
DenisChenu

DenisChenu

2025-11-20 08:27

developer   ~83863

Check to close

DenisChenu

DenisChenu

2026-01-12 11:15

developer   ~84082

I think this is not a issue anymore since you theoretically can use question themes. Correct?

  1. Plugin =/= theme
  2. Survey theme =/= Question theme
  3. Some scripts come PHP not from twig ( example : https://github.com/LimeSurvey/LimeSurvey/blob/71e44446609db5414a0fe84254d6b733f1ef7e3f/application/core/QuestionTypes/Date/RenderDate.php#L43)

(For 3 : it can be a DEV issue for 7.X : move all register script file to registerScriptFile twig function in answers : (None currently]

(Here I try to do it in survey theme.)

Here the issue are {{ unregisterScriptFile }} Yii function use Yii::app()->clientScript->unregisterScriptFile

This function unregisters only POS_HEAD script : https://github.com/yiisoft/yii/blob/a2d4af95af420d1d77116e91b50d8c9cbff62673/framework/web/CClientScript.php#L25

We need a way to (i think both solutions are valid in my opinoion).

  1. Allow to set the position in boith function (default 0)
  2. unegister all script (see after)
for ($position = 0; $i <= 6; $i++) {
    unset($this->scriptFiles[$position][$sName]);
}

I can create both PR

DenisChenu

DenisChenu

2026-01-12 11:15

developer   ~84083

Did I create a PR with solution #1 or #2 ?

Issue History

Date Modified Username Field Change
2019-06-24 09:54 DenisChenu New Issue
2019-06-24 09:58 DenisChenu Note Added: 52493
2025-11-19 18:05 c_schmitz Note Added: 83853
2025-11-19 18:05 c_schmitz Bug heat 2 => 4
2025-11-20 08:26 DenisChenu Note Added: 83862
2025-11-20 08:27 DenisChenu Assigned To => DenisChenu
2025-11-20 08:27 DenisChenu Status new => feedback
2025-11-20 08:27 DenisChenu Complete LimeSurvey version number (& build) 3.17.5 github => 6
2025-11-20 08:27 DenisChenu Note Added: 83863
2026-01-12 11:15 DenisChenu Note Added: 84082
2026-01-12 11:15 DenisChenu Assigned To DenisChenu => c_schmitz
2026-01-12 11:15 DenisChenu Note Added: 84083
2026-01-12 11:15 DenisChenu Status feedback => assigned