Skip to content

Commit

Permalink
Fixed issue #9964: LS3 - .lss import error due to template formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
SamMousa committed Oct 22, 2015
1 parent 90a3acd commit 7d1e68a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion protected/controllers/tokens/Clear.php
Expand Up @@ -24,7 +24,7 @@ public function run($surveyId)
if (App()->request->getIsDeleteRequest()) {
/** @todo Implement this. */
if (Token::model($surveyId)->deleteAll()) {
App()->user->setFlash('info', gT("Deleting all tokens not yet implemented."));
App()->user->setFlash('success', gT("Tokens removed"));
$this->redirect(['tokens/index', 'surveyId' => $surveyId]);
}
} else {
Expand Down
4 changes: 4 additions & 0 deletions protected/helpers/import/importers/Import178.php
Expand Up @@ -112,6 +112,10 @@ protected function importSurvey($data) {
$oldKey = $survey->primaryKey;
$survey->primaryKey = null;
$questionMap = [];
// Workaround for unknown templates.
if (!$survey->validate(['template'])) {
$survey->template = null;
}
if (!$survey->save()) {
throw new \Exception("Could not save survey." . print_r($survey->errors, true));
}
Expand Down
1 change: 1 addition & 0 deletions protected/models/Survey.php
Expand Up @@ -245,6 +245,7 @@ public function rules()
['format', \CDefaultValueValidator::class, 'value' => self::FORMAT_ALL_IN_ONE],
['admin', \CDefaultValueValidator::class, 'value' => App()->user->getName()],
['template', \CDefaultValueValidator::class, 'value' => 'default'],

['datecreated', 'default', 'value' => date("Y-m-d")],
['startdate', 'default', 'value' => null],
['expires', 'default', 'value' => null],
Expand Down
2 changes: 2 additions & 0 deletions protected/views/tokens/export.php
@@ -0,0 +1,2 @@
<?php
echo "@todo";

0 comments on commit 7d1e68a

Please sign in to comment.