View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 04440 | Bug reports | Survey editing | public | 2010-06-23 08:23 | 2010-07-06 12:30 |
| Reporter | lamjas | Assigned To | mdekker | ||
| Priority | normal | Severity | minor | ||
| Status | closed | Resolution | fixed | ||
| Product Version | 1.90RC1 | ||||
| Fixed in Version | 1.90RC2 | ||||
| Summary | 04440: Order is the opposite after importing a question group | ||||
| Description | I have created two survey (A and B) in the latest release (1.90RCI). In Survey A, I created a question group. I exported the group and imported it in Survey B. During the import, an error occurred at the top of browser: Warning: Invalid argument supplied for foreach() in /***/survey/admin/importgroup.php on line 1124 However, it still indicated that the import was successful. I found that the order of the questions are opposite (e.g. Q1, Q2, Q3 becomes Q3, Q2, Q1). | ||||
| Tags | No tags attached. | ||||
| Attached Files | importgroup.diff (1,424 bytes)
### Eclipse Workspace Patch 1.0
#P limesurvey
Index: admin/importgroup.php
===================================================================
--- admin/importgroup.php (revision 8860)
+++ admin/importgroup.php (working copy)
@@ -969,14 +969,6 @@
// then for subquestions (because we need to determine the new qids for the main questions first)
$tablename=$dbprefix.'questions';
$results['questions']=0;
- $newquestionorder=$connect->GetOne("SELECT MAX(question_order) AS maxqo FROM ".db_table_name('questions')." WHERE sid=$newsid AND gid=$newgid")+1;
- if (is_null($newquestionorder))
- {
- $newquestionorder=0;
- }
- else {
- $newquestionorder++;
- }
foreach ($xml->questions->rows->row as $row)
{
$insertdata=array();
@@ -987,7 +979,6 @@
$oldsid=$insertdata['sid'];
$insertdata['sid']=$newsid;
$insertdata['gid']=$aGIDReplacements[$insertdata['gid']];
- $insertdata['question_order']=$newquestionorder;
$oldqid=$insertdata['qid']; unset($insertdata['qid']); // save the old qid
// now translate any links
@@ -1121,7 +1112,7 @@
{
$tablename=$dbprefix.'conditions';
- foreach ($xml->defaultvalues->rows->row as $row)
+ foreach ($xml->conditions->rows->row as $row)
{
$insertdata=array();
foreach ($row as $key=>$value)
| ||||
| Bug heat | 14 | ||||
| Complete LimeSurvey version number (& build) | 8819 | ||||
| I will donate to the project if issue is resolved | |||||
| Browser | Firefox 3.6.3 | ||||
| Database type & version | MySQL 5.1.47 | ||||
| Server OS (if known) | Linux | ||||
| Webserver software & version (if known) | Apache 2.2.15 | ||||
| PHP Version | 5.2.13 | ||||
|
I tried to re-arrange the order, however it does not work at all. |
|
|
Can confirm this is an error by just looking at the code. If possible, could you change line 1124 in importgroup.php and check the results? The section reads:
The last row is 1124 and the defaultvalues should be changed to conditions
|
|
|
Doesn't fix the ordering issue, but will fix the error. For the ordering you need another adjustment. I'll work on a patch and attach it here. |
|
|
Attached a patch and fixed in svn 8865. |
|
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2010-06-23 08:23 | lamjas | New Issue | |
| 2010-06-23 08:23 | lamjas | Status | new => assigned |
| 2010-06-23 08:23 | lamjas | Assigned To | => user372 |
| 2010-06-23 08:25 | lamjas | Note Added: 12286 | |
| 2010-06-23 08:54 | mdekker | Note Added: 12288 | |
| 2010-06-23 08:55 | mdekker | Note Edited: 12288 | |
| 2010-06-23 08:55 | mdekker | Note Edited: 12288 | |
| 2010-06-23 08:55 | mdekker | Note Edited: 12288 | |
| 2010-06-23 08:56 | mdekker | Note Edited: 12288 | |
| 2010-06-23 09:00 | mdekker | Note Added: 12289 | |
| 2010-06-23 09:02 | mdekker | Assigned To | user372 => mdekker |
| 2010-06-23 09:14 | mdekker | File Added: importgroup.diff | |
| 2010-06-23 09:16 | mdekker | Note Added: 12290 | |
| 2010-06-23 09:16 | mdekker | Status | assigned => resolved |
| 2010-06-23 09:16 | mdekker | Fixed in Version | => 1.90RC2 |
| 2010-06-23 09:16 | mdekker | Resolution | open => fixed |
| 2010-07-06 11:22 | c_schmitz | Status | resolved => closed |
| 2010-07-06 12:30 | dans | Issue Monitored: dans | |
| 2010-07-06 13:12 | c_schmitz | Relationship added | has duplicate 04465 |
| 2010-07-13 01:33 | Mazi | Relationship added | related to 04396 |
| 2010-10-25 00:17 | c_schmitz | Category | Survey Design => Survey design |
| 2019-11-01 17:25 | c_schmitz | Category | Survey design => Survey editing |
| 2021-08-03 07:55 | guest | Bug heat | 12 => 14 |