View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
10142Bug reportsSurvey editingpublic2016-01-08 15:36
ReporterDenisChenu Assigned Toollehar  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version2.50.x 
Fixed in Version2.50.x 
Summary10142: We ca n add question to an active survey
Description

The "Survey quick actions/Add a new question" is shown for an active survey.
Click on this button allow to add a question.

Steps To Reproduce

Go to a question with an actove survey.
Look at bottom

Click on button
Put anything in title
Save : a new question is added

Additional Information

We have 2 bug here.

  • 1st : we must hide/disable this button
  • 2nd : We must disallow admin/questions/sa/newquestion (action /index.php/admin/database/index too)

The 2nd must be done in Model too (surely a bug in 2.06 too).

TagsNo tags attached.
Attached Files
Bug heat6
Complete LimeSurvey version number (& build)151212
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

2015-12-12 12:48

developer   ~33899

I must test with a simple survey : but we have surely some "BD save" issue when do the survey.

ollehar

ollehar

2015-12-14 15:38

administrator   ~33906

What action is this? /index.php/admin/database/index

ollehar

ollehar

2015-12-14 15:45

administrator   ~33907

Fix committed to 2.5 branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=16482

DenisChenu

DenisChenu

2015-12-14 15:53

developer   ~33908

1st : button appear at : index.php/admin/questions/sa/view/surveyid/282267/gid/8/qid/35
2nd click on button
/index.php/admin/questions/sa/newquestion/surveyid/282267/gid/8 : must be disable
3rd : send $_POST to /index.php/admin/database/index with : action=insertquestion work actually : this must controlled too.

Easy way : Add a control here : if ($oSurvey->active=="Y") ....
Better way (i think) : in model.

Using if($this->isNewRecord) in a new extended function : beforeSave : http://www.yiiframework.com/doc/api/1.1/CActiveRecord#beforeSave-detail or in rules (don't know the best)

This must return false and

ollehar

ollehar

2015-12-14 16:05

administrator   ~33909

Fix committed to 2.5 branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=16484

ollehar

ollehar

2015-12-14 16:27

administrator   ~33910

Last edited: 2015-12-14 16:28

3rd : send $_POST to /index.php/admin/database/index with : action=insertquestion work actually : this must controlled too.

I cannot reproduce this. What $_POST did you send?

ollehar

ollehar

2015-12-14 16:40

administrator   ~33911

Added check in controller and disabled button in view.

DenisChenu

DenisChenu

2015-12-14 17:09

developer   ~33915

I looking at code for $_POST. I didn't say it can be done actually without hacking the HTML view by user (any user can update his HTML to send any value to any inout name).
But always better if we stop Broken behaviour at model.

DenisChenu

DenisChenu

2015-12-17 09:19

developer   ~34032

The Survey quick action button is still here (and clickable). Return alert is OK :)

ollehar

ollehar

2015-12-17 12:40

administrator   ~34041

Fix committed to 2.5 branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=16617

ollehar

ollehar

2015-12-17 12:42

administrator   ~34042

@Denis, what quick action button exactly? Screenshot?

ollehar

ollehar

2015-12-17 12:43

administrator   ~34043

@Denis, did you pull before re-open?

ollehar

ollehar

2015-12-17 14:17

administrator   ~34044

Fix committed to 2.5 branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=16623

DenisChenu

DenisChenu

2015-12-17 14:29

developer   ~34046

Olle : i can confirm the issue, maybe assets ?

Just now:
$ git reset --hard
$ git pull

Goes to an active survey by 'Question group/question explorer' : see the button. Reload the page (maybe some JS) : button still here.

Click on it : go to index.php/admin/questions/sa/view/surveyid/282267/gid/9/qid/42 with " Cannot add questions while the survey is active. " alert.

HTML code of "button" :
<div aria-data-url="/index.php/admin/questions/sa/newquestion/surveyid/282267/gid/9" id="pannel-1" class="panel panel-primary panel-clickable" style="opacity: 1; top: 0px;">
<div class="panel-heading">
<h4 class="panel-title">Ajouter une nouvelle question au groupe</h4>
</div>
<div class="panel-body">
<a href="/index.php/admin/questions/sa/newquestion/surveyid/282267/gid/9">
<span style="font-size: 3em;" class="icon-add text-success"></span>
</a>
<p> /index.php/admin/questions/sa/newquestion/surveyid/282267/gid/9
</p>
</div>
</div>

PS: this panel must NOT exist.

ollehar

ollehar

2015-12-17 15:24

administrator   ~34049

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

ollehar

ollehar

2015-12-17 15:47

administrator   ~34050

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

c_schmitz

c_schmitz

2016-01-08 15:36

administrator   ~34205

Version 2.5RC6 released

Related Changesets

LimeSurvey: 2.5 b1dd710c

2015-12-14 14:35:35

ollehar

Details Diff
Fixed issue 10142: Don't allow new question when survey is active Affected Issues
10142
mod - application/controllers/admin/questions.php Diff File

LimeSurvey: 2.5 ba686054

2015-12-14 15:05:35

ollehar

Details Diff
Fixed issue 10142 (part 2): Disable add new question button when survey is active Affected Issues
10142
mod - application/core/Survey_Common_Action.php Diff File
mod - application/views/admin/survey/QuestionGroups/group_view.php Diff File
mod - application/views/admin/survey/QuestionGroups/nquestiongroupbar_view.php Diff File

LimeSurvey: 2.5 d988add5

2015-12-17 11:39:44

ollehar

Details Diff
Fixed issue 10142: Disable group list add question-button when survey is active Affected Issues
10142
mod - application/models/QuestionGroup.php Diff File

LimeSurvey: 2.5 5640a97e

2015-12-17 13:17:38

ollehar

Details Diff
Fixed issue 10142: Make sure you can't save question group while survey is active Affected Issues
10142
mod - application/controllers/admin/questiongroups.php Diff File
mod - application/models/QuestionGroup.php Diff File

LimeSurvey: 2.5 23cbd076

2015-12-17 14:24:12

ollehar

Details Diff
Fixed issue 10142: Make sure you can't save question while survey is active Affected Issues
10142
mod - application/controllers/admin/database.php Diff File
mod - application/models/Question.php Diff File

LimeSurvey: 2.5 ab91d574

2015-12-17 14:47:33

ollehar

Details Diff
Fixed issue 10142: Disable survey quick action in question summary when survey is active Affected Issues
10142
mod - application/controllers/admin/questions.php Diff File
mod - application/views/admin/survey/Question/question_view.php Diff File

Issue History

Date Modified Username Field Change
2015-12-12 12:48 DenisChenu New Issue
2015-12-12 12:48 DenisChenu Status new => assigned
2015-12-12 12:48 DenisChenu Assigned To => LouisGac
2015-12-12 12:48 DenisChenu Note Added: 33899
2015-12-14 15:13 ollehar Assigned To LouisGac => ollehar
2015-12-14 15:38 ollehar Note Added: 33906
2015-12-14 15:45 ollehar Changeset attached => LimeSurvey 2.5 b1dd710c
2015-12-14 15:45 ollehar Note Added: 33907
2015-12-14 15:45 ollehar Resolution open => fixed
2015-12-14 15:53 DenisChenu Note Added: 33908
2015-12-14 15:53 DenisChenu File Added: Capture du 2015-12-14 15-45-30.png
2015-12-14 16:05 ollehar Changeset attached => LimeSurvey 2.5 ba686054
2015-12-14 16:05 ollehar Note Added: 33909
2015-12-14 16:27 ollehar Note Added: 33910
2015-12-14 16:28 ollehar Note Edited: 33910
2015-12-14 16:40 ollehar Note Added: 33911
2015-12-14 16:40 ollehar Status assigned => resolved
2015-12-14 16:40 ollehar Fixed in Version => 2.5
2015-12-14 17:09 DenisChenu Note Added: 33915
2015-12-17 09:19 DenisChenu Note Added: 34032
2015-12-17 09:31 c_schmitz Status resolved => feedback
2015-12-17 09:31 c_schmitz Resolution fixed => reopened
2015-12-17 09:31 c_schmitz Status feedback => assigned
2015-12-17 12:40 ollehar Changeset attached => LimeSurvey 2.5 d988add5
2015-12-17 12:40 ollehar Note Added: 34041
2015-12-17 12:42 ollehar Note Added: 34042
2015-12-17 12:43 ollehar Note Added: 34043
2015-12-17 14:17 ollehar Changeset attached => LimeSurvey 2.5 5640a97e
2015-12-17 14:17 ollehar Note Added: 34044
2015-12-17 14:29 DenisChenu Note Added: 34046
2015-12-17 15:24 ollehar Changeset attached => LimeSurvey 2.5 23cbd076
2015-12-17 15:24 ollehar Note Added: 34049
2015-12-17 15:47 ollehar Changeset attached => LimeSurvey 2.5 ab91d574
2015-12-17 15:47 ollehar Note Added: 34050
2015-12-17 15:52 ollehar Status assigned => resolved
2015-12-17 15:52 ollehar Resolution reopened => fixed
2016-01-08 15:36 c_schmitz Note Added: 34205
2016-01-08 15:36 c_schmitz Status resolved => closed
2019-11-01 17:25 c_schmitz Category Survey design => Survey editing