Skip to content

Commit

Permalink
Fixed issue #13794: RPC add_response reports error, still inserts a r…
Browse files Browse the repository at this point in the history
…esponse record
  • Loading branch information
olleharstedt committed Jun 21, 2018
1 parent f392f4d commit 09b03e2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion application/helpers/remotecontrol/remotecontrol_handle.php
Expand Up @@ -2535,6 +2535,8 @@ public function remind_participants($sSessionKey, $iSurveyID, $iMinDaysBetween =
* @param int $iSurveyID ID of the Survey to insert responses
* @param array $aResponseData The actual response
* @return int|array The response ID
* @todo Need to clean up return array, especially the case when response was added but file not uploaded.
* @todo See discussion: https://bugs.limesurvey.org/view.php?id=13794
*/
public function add_response($sSessionKey, $iSurveyID, $aResponseData)
{
Expand Down Expand Up @@ -2597,7 +2599,10 @@ public function add_response($sSessionKey, $iSurveyID, $aResponseData)
}

if (!rename($sFileTempName, $sFileRealName)) {
return array('status' => 'Unable to move files '.$sFileTempName.' '.$sFileRealName);
return array(
'status' => 'Unable to move files '.$sFileTempName.' '.$sFileRealName,
'result_id' => $result_id
);
}
}

Expand Down

0 comments on commit 09b03e2

Please sign in to comment.