Skip to content

Commit

Permalink
New feature: JSON available as export option for responses
Browse files Browse the repository at this point in the history
Fixed issue: RemoteControl API JSON export broken if first field it not response ID
  • Loading branch information
c-schmitz committed Oct 2, 2020
1 parent 311b453 commit 9a3a3e7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 3 additions & 1 deletion application/core/plugins/Authdb/Authdb.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,9 @@ public function listExportOptions()
case 'html':
$event->set('label', gT("HTML"));
break;
case 'json': // Not in the interface, only for RPC
case 'json':
$event->set('label', gT("JSON"));
break;
default:
break;
}
Expand Down
3 changes: 1 addition & 2 deletions application/helpers/admin/export/JsonWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ public function init(SurveyObj $survey, $sLanguageCode, FormattingOptions $oOpti

protected function outputRecord($headers, $values, FormattingOptions $oOptions)
{
$aJson = [];
$aJson[$values[0]] = array_combine($headers, $values);
$aJson = array_combine($headers, $values);
$sJson = json_encode($aJson);
Yii::log($this->havePrev, 'info', 'info');
if ($this->havePrev) {
Expand Down

0 comments on commit 9a3a3e7

Please sign in to comment.