View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
07629 | Bug reports | RemoteControl | public | 2013-03-01 14:06 | 2013-03-05 08:45 |
Reporter | mfaber | Assigned To | c_schmitz | ||
Priority | normal | Severity | block | ||
Status | closed | Resolution | fixed | ||
Product Version | 2.00+ | ||||
Fixed in Version | 2.00+ | ||||
Summary | 07629: fatal error on unexpected key/data in response array (RPC add_response) | ||||
Description | Using the JSON-RPC add_response function I add answers to the Fatal error: Uncaught exception 'Exception' with message 'Request I would expect the add_response function to either ignore such "additional" | ||||
Steps To Reproduce | Here's a code snippet that I'm using to test: $post="542856X167X1616=Y&542856X168X1617=12&542856X168X1618=F&542856X168X1619=6&542856X169X1620=Y&542856X169X1621=&542856X169X1622SQ001=Y&542856X169X1622SQ002=U&542856X169X1622SQ003=N&542856X169X1622SQ004=Y&542856X169X1622SQ005=U&542856X170X1623=Y&542856X170X1624SQ001=Y&542856X170X1624SQ002=U&542856X170X1624SQ003=N&542856X170X1624SQ004=&testkey="; // convert string to an associative array // does it look ok? //add response to the LS database // show the reponse code | ||||
Additional Information | This is the array that works ok IF the last key [testkey] is not part of Array ( [542856X167X1616] => Y [542856X168X1617] => 12 I would expect the add_response function to either ignore unexpected "additional" data or return an error code but still add all responses that fit. | ||||
Tags | No tags attached. | ||||
Attached Files | responsedata.txt (639 bytes)
Array ( [542856X167X1616] => Y [542856X168X1617] => 12 [542856X168X1618] => F [542856X168X1619] => 6 [542856X169X1620] => Y [542856X169X1621] => [542856X169X1622SQ001] => Y [542856X169X1622SQ002] => U [542856X169X1622SQ003] => N [542856X169X1622SQ004] => Y [542856X169X1622SQ005] => U [542856X170X1623] => Y [542856X170X1624SQ001] => Y [542856X170X1624SQ002] => U [542856X170X1624SQ003] => N [542856X170X1624SQ004] => [submitdate] => 2013-03-02 09:54:59 [startlanguage] => de-informal [datestamp] => 2013-03-02 09:54:59 [startdate] => 2013-03-02 09:54:59 ) destination.txt (640 bytes)
Array ( [0] => id [1] => token [2] => submitdate [3] => lastpage [4] => startlanguage [5] => startdate [6] => datestamp [7] => 542856X167X1616 [8] => 542856X168X1617 [9] => 542856X168X1618 [10] => 542856X168X1619 [11] => 542856X169X1620 [12] => 542856X169X1621 [13] => 542856X169X1622SQ001 [14] => 542856X169X1622SQ002 [15] => 542856X169X1622SQ003 [16] => 542856X169X1622SQ004 [17] => 542856X169X1622SQ005 [18] => 542856X170X1623 [19] => 542856X170X1624SQ001 [20] => 542856X170X1624SQ002 [21] => 542856X170X1624SQ003 [22] => 542856X170X1624SQ004 ) | ||||
Bug heat | 6 | ||||
Complete LimeSurvey version number (& build) | 130226 | ||||
I will donate to the project if issue is resolved | No | ||||
Browser | Chrome | ||||
Database type & version | MySQL 5.0.1.0 (XAMPP) | ||||
Server OS (if known) | WinXP | ||||
Webserver software & version (if known) | Apache/2.4.3 (Win32) OpenSSL/1.0.1c (XAMPP) | ||||
PHP Version | PHP/5.4.7 (XAMPP) | ||||
Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=11705 |
|
Thanks for the super quick reaction. Unfortunatly, now, no answers at all are imported. |
|
c_schmitz, The intersection does not seems to work. I tried with array_intersect_key but to no avail. If I can do anything else, please let me know. |
|
It works with line 2260 as follows (flipped destination array and used array_intersect_key): $aResponseData=array_intersect_key($aResponseData, array_flip($aBasicDestinationFields)); Please check before implementing if this is ok, i am not a programmer and i am just learning a bit of PHP through limesurvey. |
|
Hello!, Yes, that's the correct solution. Very nice! |
|
Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=11709 |
|
Fix committed to 2.1 branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=11738 |
|
2.00+ Build 130305 released. |
|
LimeSurvey: master 97a166e4 2013-03-01 14:42 Details Diff |
Fixed issue 07629: Fatal error on unexpected key/data when using RPC function add_response |
Affected Issues 07629 |
|
mod - application/controllers/admin/remotecontrol.php | Diff File | ||
LimeSurvey: master 78f17a30 2013-03-02 14:16 Details Diff |
Fixed issue 07629: Fatal error on unexpected key/data when using RPC function add_response |
Affected Issues 07629 |
|
mod - application/controllers/admin/remotecontrol.php | Diff File | ||
LimeSurvey: 2.1 fca41d2a 2013-03-02 15:37 Details Diff |
Fixed issue 07629: Fatal error on unexpected key/data when using RPC function add_response |
Affected Issues 07629 |
|
mod - application/controllers/admin/remotecontrol.php | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2013-03-01 14:06 | mfaber | New Issue | |
2013-03-01 14:19 | mfaber | Issue Monitored: mfaber | |
2013-03-01 14:41 | c_schmitz | Assigned To | => c_schmitz |
2013-03-01 14:41 | c_schmitz | Status | new => assigned |
2013-03-01 14:42 | c_schmitz | Changeset attached | => LimeSurvey master 97a166e4 |
2013-03-01 14:42 | c_schmitz | Note Added: 24448 | |
2013-03-01 14:42 | c_schmitz | Resolution | open => fixed |
2013-03-01 14:43 | c_schmitz | Status | assigned => resolved |
2013-03-01 14:43 | c_schmitz | Fixed in Version | => 2.00+ |
2013-03-01 21:59 | mfaber | Note Added: 24460 | |
2013-03-01 21:59 | mfaber | Status | resolved => feedback |
2013-03-01 21:59 | mfaber | Resolution | fixed => reopened |
2013-03-02 09:58 | mfaber | File Added: responsedata.txt | |
2013-03-02 09:59 | mfaber | File Added: destination.txt | |
2013-03-02 10:00 | mfaber | File Added: intersect.txt | |
2013-03-02 10:02 | mfaber | Note Added: 24461 | |
2013-03-02 10:02 | mfaber | Status | feedback => assigned |
2013-03-02 12:24 | mfaber | Note Added: 24462 | |
2013-03-02 14:10 | c_schmitz | Note Added: 24463 | |
2013-03-02 14:16 | c_schmitz | Status | assigned => resolved |
2013-03-02 14:16 | c_schmitz | Resolution | reopened => fixed |
2013-03-02 14:16 | c_schmitz | Changeset attached | => LimeSurvey master 78f17a30 |
2013-03-02 14:16 | c_schmitz | Note Added: 24464 | |
2013-03-02 16:34 | c_schmitz | Changeset attached | => LimeSurvey 2.1 fca41d2a |
2013-03-02 16:34 | c_schmitz | Note Added: 24490 | |
2013-03-05 08:45 | c_schmitz | Note Added: 24533 | |
2013-03-05 08:45 | c_schmitz | Status | resolved => closed |
2021-08-03 23:10 | guest | Bug heat | 4 => 6 |