Skip to content

Commit

Permalink
Fixed issue #17622: Cant export "Not completed" survey participant wh…
Browse files Browse the repository at this point in the history
…en "Anonymized responses" is set "No" (#2080)
  • Loading branch information
olleharstedt committed Oct 22, 2021
1 parent ec55c63 commit d2f29d4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions application/helpers/export_helper.php
Expand Up @@ -2313,9 +2313,13 @@ function tokensExport($iSurveyID)
foreach ($bresultAll as $tokenKey => $tokenValue) {
// creating TokenDynamic object to be able to decrypt easier
$token = TokenDynamic::model($iSurveyID);
// populate TokenDynamic object with values
$attributes = array_keys($token->getAttributes());
// Populate TokenDynamic object with values
// NB: $tokenValue also contains values not belonging to TokenDynamic model (joined with survey)
foreach ($tokenValue as $key => $value) {
$token->$key = $value;
if (in_array($key, $attributes)) {
$token->$key = $value;
}
}
// decrypting
$token->decrypt();
Expand Down

0 comments on commit d2f29d4

Please sign in to comment.