Skip to content

Commit

Permalink
Fix SUPReMM data warehouse export regression (#1520)
Browse files Browse the repository at this point in the history
  • Loading branch information
jtpalmer authored Mar 30, 2021
1 parent 49eeeff commit 4fed4da
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion classes/DataWarehouse/Data/BatchDataset.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ private function getNextRow()
$row = [];

foreach ($this->fields as $field) {
$key = $field['name'];
$key = $field['alias'];
$row[] = $field['anonymize']
? $this->anonymizeField($rawRow[$key])
: $rawRow[$key];
Expand Down
6 changes: 6 additions & 0 deletions classes/DataWarehouse/Data/RawStatisticsConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,11 @@ public function getBatchExportFieldDefinitions($realm)
$fields = [];

foreach ($this->getQueryFieldDefinitions($realm) as $field) {
// Skip "ignore" and "analysis" dtype
if (isset($field['dtype']) && in_array($field['dtype'], ['ignore', 'analysis'])) {
continue;
}

$export = isset($field['batchExport']) ? $field['batchExport'] : false;
if ($export === false) {
continue;
Expand All @@ -208,6 +213,7 @@ public function getBatchExportFieldDefinitions($realm)

$fields[] = [
'name' => $field['name'],
'alias' => isset($field['alias']) ? $field['alias'] : $field['name'],
'display' => $display,
'anonymize' => ($export === 'anonymize'),
'documentation' => $field['documentation']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@
"name": {
"type": "string"
},
"alias": {
"type": "string"
},
"display": {
"type": "string"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,6 @@ public function testDeleteRequests($role, $httpCode, $schema)
$ids[] = $datum['id'];
}
$data = json_encode($ids);
//$this->assertTrue(false, json_encode($beforeContent['data']));

// Delete all existing requests.
list($content, $info, $headers) = self::$helpers[$role]->delete('rest/warehouse/export/requests', null, $data);
Expand Down

0 comments on commit 4fed4da

Please sign in to comment.