Skip to content

Commit

Permalink
Fixed issue #14050: Unable to import all responses if startdate added
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikvitt committed Sep 14, 2018
1 parent ffcef64 commit d21f31c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion application/controllers/admin/dataentry.php
Expand Up @@ -320,11 +320,19 @@ public function import($surveyid)
$targetResponse[$targetField] = $sourceResponse[$sourceField];
}

if (isset($targetSchema->columns['startdate']) && empty($targetResponse['startdate'])){
$targetResponse['startdate'] = date("Y-m-d H:i", (int) mktime(0, 0, 0, 1, 1, 1980));
}

if (isset($targetSchema->columns['datestamp']) && empty($targetResponse['datestamp'])){
$targetResponse['datestamp'] = date("Y-m-d H:i", (int) mktime(0, 0, 0, 1, 1, 1980));
}

$beforeDataEntryImport = new PluginEvent('beforeDataEntryImport');
$beforeDataEntryImport->set('iSurveyID', $iSurveyId);
$beforeDataEntryImport->set('oModel', $targetResponse);
App()->getPluginManager()->dispatchEvent($beforeDataEntryImport);

$imported++;
$targetResponse->save();
$aSRIDConversions[$iOldID] = $targetResponse->id;
Expand Down

0 comments on commit d21f31c

Please sign in to comment.