View Issue Details

This bug affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
06065Bug reportsImport/Exportpublic2012-05-10 12:22
Reporteruser19702Assigned Toc_schmitz  
PrioritynormalSeveritypartial_block 
Status closedResolutionfixed 
Product Version1.92+ 
Fixed in Version1.92+ 
Summary06065: Error when creating a new survey by copying an existing one
Description

When creating a new survey by copying an existing one, I receive the following error message:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and surveyls_survey_id= and surveyls_language='en'' at line 1:SELECT * FROM lime_surveys,lime_surveys_languagesettings WHERE sid= and surveyls_survey_id= and surveyls_language='en'

The new survey is how ever correctly created.

Steps To Reproduce

Not sure if all is required:

1) Log in as admin
2) Log out
3) Log in as another user (less privileged)
4) Click "Create, import or copy a survey"
5) Go to "Copy" tab
6) Select survey to copy: (select a survey created by admin)
7) New survey name: (give name to the new survey)
8) Click "Copy survey"

Additional Information

This happens with both PostgreSQL and MySQL. Limesurvey default language is set to Finnish. In admin.php?action=personalsettings the user interface language is also set to Finnish for both admin and the less-privileged user. Survey language is Finnish with no additional languages.

TagsNo tags attached.
Attached Files
limesurvey_bug.zip (72,608 bytes)
Bug heat4
Complete LimeSurvey version number (& build)120501
I will donate to the project if issue is resolvedNo
BrowserFirefox and IE
Database type & versionmysql-server.i686 5.1.61-1.el6_2.1
Server OS (if known)Linux (CentOS-6.2) 2.6.32-220.13.1.el6.i686 #1 SMP Tue Apr 17 22:09:08 BST 2012 i686
Webserver software & version (if known)Apache/2.2.15 (CentOS)
PHP VersionPHP Version 5.3.3

Users monitoring this issue

There are no users monitoring this issue.

Activities

c_schmitz

c_schmitz

2012-05-07 12:04

administrator   ~18594

I am sorry but I cannot reproduce this.
Please give on details what kind of permissions this less privileged user has on global and survey level.
He must have some kind of survey level privileges because otherwise the particulat survey would not be listed in the survey dropdown on copy.

user19702

2012-05-07 12:38

  ~18595

I tried also with all permissons granted on survey level, but the error is still produced. Admin and the less-privileged user both belong to the same group, and the less-privileged user can only see surveys in it's own group.

c_schmitz

c_schmitz

2012-05-07 13:52

administrator   ~18603

Sorry, still can't reproduce. Can you please try to reproduce this on our demo installation and give us the login data of the particular user?

user19702

2012-05-07 14:19

  ~18604

The demo installations seems to be broken: Table '2_demo.lime_survey_permissions' doesn't exist: SELECT a.*, surveyls_title, surveyls_description, surveyls_welcometext, surveyls_url FROM lime_surveys AS a INNER JOIN lime_surveys_languagesettings on (surveyls_survey_id=a.sid and surveyls_language=a.language) WHERE a.sid in (select sid from lime_survey_permissions where uid=161 and permission='survey' and read_p=1) order by active DESC, surveyls_title

Don't know if I broke it or someone else? I added a new group bug_6065 and user user_bug_6065 to that group (members admin, user_bug_6065). Created a survey as admin (with survey language Suomi/Finnish). After logging out and trying to log in as user_bug_6065, the above error is received. So cannot test at the moment.

c_schmitz

c_schmitz

2012-05-07 14:25

administrator   ~18605

hotspants: no you didnt. I just fixed the demo. please try again.

c_schmitz

c_schmitz

2012-05-07 14:29

administrator   ~18606

Btw, user_bug_6065 has password: 'test'

user19702

2012-05-07 14:43

  ~18607

Now I get: Table '2_demo.lime_quota_members' doesn't exist:SELECT lime_quota_members.* FROM lime_quota_members WHERE lime_quota_members.sid=49963

c_schmitz

c_schmitz

2012-05-07 14:46

administrator   ~18608

Fixed. Sorry, try again, please ;)

user19702

2012-05-07 14:51

  ~18609

Now I get the same error as in our own environment: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and surveyls_survey_id= and surveyls_language='en'' at line 1:SELECT * FROM lime_surveys,lime_surveys_languagesettings WHERE sid= and surveyls_survey_id= and surveyls_language='en'

i.e. as user_bug_6065 I copied the survey "bug 6065" to the name "test2 / copied from admin"

user19702

2012-05-07 14:59

  ~18610

Btw, when debug=1, I also get:
Notice: Undefined index: LEMsid in /opt/bitnami/limesurvey/classes/expressions/LimeExpressionManager.php on line 3332 Notice: Undefined index: s_lang in /opt/bitnami/limesurvey/common_functions.php on line 3069

c_schmitz

c_schmitz

2012-05-07 15:09

administrator   ~18611

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

c_schmitz

c_schmitz

2012-05-07 15:10

administrator   ~18612

Thank you very much. That way I could reproduce and resolve it!

c_schmitz

c_schmitz

2012-05-07 15:12

administrator   ~18613

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

user19702

2012-05-08 09:15

  ~18619

Good to hear! Can you estimate when the fix will be released? Would it break the ComfortUpdate if i were to patch my installation myself? i.e. add
LimeExpressionManager::SetSurveyId($newsid); to admin/import_functions.php?

Thanks again

c_schmitz

c_schmitz

2012-05-08 09:17

administrator   ~18620

A new version will be released tomorrow.
Yes, you can add the line without breaking ComfortUpdate.

user19702

2012-05-08 10:57

  ~18626

One more thing: I find it confusing when having copied a survey, the original is set active instead of the newly created one. You'd have to click "Go to survey" or select the new survey from to drop down list to get to the new survey. I have made the mistake of modifying the original while I thought I was working with the new one more than a few times. That's the main reason I keep the survey permissions as restrictive as possible (for non-admin users). I'll attach a screen shot from the demo environment just to clarify.

Related Changesets

LimeSurvey: master 684b6624

2012-05-07 06:10:13

c_schmitz

Details Diff
Fixed issue 06065: Error when creating a new survey by copying an existing one Affected Issues
06065
mod - admin/import_functions.php Diff File

LimeSurvey: Yii f177ee8b

2012-05-07 06:13:03

c_schmitz

Details Diff
Fixed issue 06065: Error when creating a new survey by copying an existing one Affected Issues
06065
mod - application/helpers/admin/import_helper.php Diff File

Issue History

Date Modified Username Field Change
2012-05-04 14:36 user19702 New Issue
2012-05-04 14:53 user19702 Issue Monitored: user19702
2012-05-05 23:20 c_schmitz Assigned To => c_schmitz
2012-05-05 23:20 c_schmitz Status new => assigned
2012-05-07 12:04 c_schmitz Note Added: 18594
2012-05-07 12:04 c_schmitz Status assigned => feedback
2012-05-07 12:36 user19702 File Added: limesurvey_bug.zip
2012-05-07 12:38 user19702 Note Added: 18595
2012-05-07 12:38 user19702 Status feedback => assigned
2012-05-07 13:52 c_schmitz Note Added: 18603
2012-05-07 13:52 c_schmitz Status assigned => feedback
2012-05-07 14:19 user19702 Note Added: 18604
2012-05-07 14:19 user19702 Status feedback => assigned
2012-05-07 14:25 c_schmitz Note Added: 18605
2012-05-07 14:29 c_schmitz Note Added: 18606
2012-05-07 14:43 user19702 Note Added: 18607
2012-05-07 14:46 c_schmitz Note Added: 18608
2012-05-07 14:51 user19702 Note Added: 18609
2012-05-07 14:59 user19702 Note Added: 18610
2012-05-07 15:09 c_schmitz Changeset attached => LimeSurvey master 684b6624
2012-05-07 15:09 c_schmitz Note Added: 18611
2012-05-07 15:09 c_schmitz Resolution open => fixed
2012-05-07 15:10 c_schmitz Note Added: 18612
2012-05-07 15:10 c_schmitz Status assigned => resolved
2012-05-07 15:10 c_schmitz Fixed in Version => 1.92+
2012-05-07 15:12 c_schmitz Changeset attached => LimeSurvey Yii f177ee8b
2012-05-07 15:12 c_schmitz Note Added: 18613
2012-05-08 09:15 user19702 Note Added: 18619
2012-05-08 09:17 c_schmitz Note Added: 18620
2012-05-08 10:57 user19702 Note Added: 18626
2012-05-08 10:59 user19702 File Added: original_survey_is_active_after_copying.png
2012-05-10 12:22 c_schmitz Status resolved => closed