Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Dev Fixed cached checking for table existence. Fixed incorrect check …
…for survey being active.
  • Loading branch information
SamMousa committed Jun 26, 2015
1 parent 8d2f630 commit ae12e20
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion application/helpers/SurveyRuntimeHelper.php
Expand Up @@ -1055,7 +1055,7 @@ function run($surveyid,$args) {
echo templatereplace(file_get_contents($sTemplatePath."navigator.pstpl"), array(), $redata);
echo "\n";

if ($session->survey->bool_active)
if (!$session->survey->bool_active)
{
echo "<p style='text-align:center' class='error'>" . gT("This survey is currently not active. You will not be able to save your responses.") . "</p>\n";
}
Expand Down
7 changes: 3 additions & 4 deletions application/models/Dynamic.php
Expand Up @@ -68,14 +68,13 @@ public static function valid($id, $refresh = false)
if (is_numeric($id) && (!isset(self::$valid[$id]) || $refresh)) {
try {
App()->db->createCommand("SELECT 1 FROM " . static::constructTableName($id))->execute();
$result = true;
self::$valid[$id] = true;
} catch (\CDbException $e) {
$result = false;
self::$valid[$id] = false;
}
self::$valid[$id] = $result;
}

return $result;
return self::$valid[$id];
}


Expand Down

0 comments on commit ae12e20

Please sign in to comment.