View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
06261Bug reportsSurvey takingpublic2012-07-19 23:34
ReporterTMSWhite Assigned ToDenisChenu  
PriorityhighSeveritypartial_block 
Status closedResolutionfixed 
Product Version2.00RC4 
Fixed in Version2.00RC5 
Summary06261: unable to preview non-active survey, group, or question
Description

If try to test a survey, get the following error:

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'ls2.lime_survey_722461' doesn't exist in C:\xampp\htdocs\ls2\framework\db\CDbCommand.php on line 497 Call Stack #TimeMemoryFunctionLocation 10.0009352160{main}( )..\index.php:0 20.03332018784CApplication->run( )..\index.php:171 30.03332018784CWebApplication->processRequest( )..\CApplication.php:162 40.03412018872CWebApplication->runController( )..\CWebApplication.php:135 50.196914545744CController->run( )..\CWebApplication.php:276 60.201414902400CController->runActionWithFilters( )..\CController.php:266 70.201414902400CController->runAction( )..\CController.php:287 80.201414902400CAction->runWithParams( )..\CController.php:309 90.201514902936index->run( )..\CAction.php:75 100.201514902936index->action( )..\index.php:18 110.325916559424SurveyRuntimeHelper->run( )..\index.php:674 120.412418972840display_first_page( )..\SurveyRuntimeHelper.php:241 130.437318631008templatereplace( )..\frontend_helper.php:2726 140.440318757632Survey_dynamic::model( )..\replacements_helper.php:406 150.440318757720CActiveRecord::model( )..\Survey_dynamic.php:37 160.440318759208CActiveRecordMetaData->construct( )..\CActiveRecord.php:379 170.440418759272CDbSchema->getTable( )..\CActiveRecord.php:2263 180.440418759384CMysqlSchema->loadTable( )..\CDbSchema.php:104 190.440518760200CMysqlSchema->findColumns( )..\CMysqlSchema.php:120 200.440518761208CDbCommand->queryAll( )..\CMysqlSchema.php:160 210.440518761584CDbCommand->queryInternal( )..\CDbCommand.php:390 220.440618763064PDOStatement->execute( )..\CDbCommand.php:497 ( ! ) CDbException: CDbCommand failed to execute the SQL statement: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'ls2.lime_survey_722461' doesn't exist. The SQL statement executed was: SHOW COLUMNS FROM lime_survey_722461 in C:\xampp\htdocs\ls2\framework\db\CDbCommand.php on line 528 Call Stack #TimeMemoryFunctionLocation 10.0009352160{main}( )..\index.php:0 20.03332018784CApplication->run( )..\index.php:171 30.03332018784CWebApplication->processRequest( )..\CApplication.php:162 40.03412018872CWebApplication->runController( )..\CWebApplication.php:135 50.196914545744CController->run( )..\CWebApplication.php:276 60.201414902400CController->runActionWithFilters( )..\CController.php:266 70.201414902400CController->runAction( )..\CController.php:287 80.201414902400CAction->runWithParams( )..\CController.php:309 90.201514902936index->run( )..\CAction.php:75 100.201514902936index->action( )..\index.php:18 110.325916559424SurveyRuntimeHelper->run( )..\index.php:674 120.412418972840display_first_page( )..\SurveyRuntimeHelper.php:241 130.437318631008templatereplace( )..\frontend_helper.php:2726 140.440318757632Survey_dynamic::model( )..\replacements_helper.php:406 150.440318757720CActiveRecord::model( )..\Survey_dynamic.php:37 160.440318759208CActiveRecordMetaData->construct( )..\CActiveRecord.php:379 170.440418759272CDbSchema->getTable( )..\CActiveRecord.php:2263 180.440418759384CMysqlSchema->loadTable( )..\CDbSchema.php:104 190.440518760200CMysqlSchema->findColumns( )..\CMysqlSchema.php:120 200.440518761208CDbCommand->queryAll( )..\CMysqlSchema.php:160 210.440518761584CDbCommand->queryInternal( )..\CDbCommand.php:390 ( ! ) CDbException: The table "{{survey_722461}}" for active record class "Survey_dynamic" cannot be found in the database. in C:\xampp\htdocs\ls2\framework\db\ar\CActiveRecord.php on line 2264 Call Stack #TimeMemoryFunctionLocation 10.0009352160{main}( )..\index.php:0 20.03332018784CApplication->run( )..\index.php:171 30.03332018784CWebApplication->processRequest( )..\CApplication.php:162 40.03412018872CWebApplication->runController( )..\CWebApplication.php:135 50.196914545744CController->run( )..\CWebApplication.php:276 60.201414902400CController->runActionWithFilters( )..\CController.php:266 70.201414902400CController->runAction( )..\CController.php:287 80.201414902400CAction->runWithParams( )..\CController.php:309 90.201514902936index->run( )..\CAction.php:75 100.201514902936index->action( )..\index.php:18 110.325916559424SurveyRuntimeHelper->run( )..\index.php:674 120.412418972840display_first_page( )..\SurveyRuntimeHelper.php:241 130.437318631008templatereplace( )..\frontend_helper.php:2726 140.440318757632Survey_dynamic::model( )..\replacements_helper.php:406 150.440318757720CActiveRecord::model( )..\Survey_dynamic.php:37 160.440318759208CActiveRecordMetaData->__construct( )..\CActiveRecord.php:379

Additional Information

CDbException
The table "{{survey_722461}}" for active record class "Survey_dynamic" cannot be found in the database.

C:\xampp\htdocs\ls2\framework\db\ar\CActiveRecord.php(2264)

2252 private $_model;
2253
2254 /*
2255
Constructor.
2256 @param CActiveRecord $model the model instance
2257
/
2258 public function __construct($model)
2259 {
2260 $this->_model=$model;
2261
2262 $tableName=$model->tableName();
2263 if(($table=$model->getDbConnection()->getSchema()->getTable($tableName))===null)
2264 throw new CDbException(Yii::t('yii','The table "{table}" for active record class "{class}" cannot be found in the database.',
2265 array('{class}'=>get_class($model),'{table}'=>$tableName)));
2266 if($table->primaryKey===null)
2267 {
2268 $table->primaryKey=$model->primaryKey();
2269 if(is_string($table->primaryKey) && isset($table->columns[$table->primaryKey]))
2270 $table->columns[$table->primaryKey]->isPrimaryKey=true;
2271 else if(is_array($table->primaryKey))
2272 {
2273 foreach($table->primaryKey as $name)
2274 {
2275 if(isset($table->columns[$name]))
2276 $table->columns[$name]->isPrimaryKey=true;
Stack Trace
#0

  • C:\xampp\htdocs\ls2\framework\db\ar\CActiveRecord.php(379): CActiveRecordMetaData->construct(Survey_dynamic)
    #1
    – C:\xampp\htdocs\ls2\application\models\Survey_dynamic.php(37): CActiveRecord::model("Survey_dynamic")
    32 if (!is_null($sid)) {
    33 self::sid($sid);
    34 $refresh = true;
    35 }
    36
    37 $model = parent::model(
    CLASS__);
    38
    39 //We need to refresh if we changed sid
    40 if ($refresh === true) $model->refreshMetaData();
    41 return $model;
    42 }
    #2
    – C:\xampp\htdocs\ls2\application\helpers\replacements_helper.php(406): Survey_dynamic::model("722461")
    401
    402 if(isset($surveyid) && !isset($saved_id) && isset($SESSION['survey'.$surveyid]['srid']))
    403 {
    404 $saved_id=$SESSION['survey'.$surveyid]['srid'];
    405 }
    406 if (isset($surveyid) && !Survey_dynamic::model($surveyid)->isCompleted(isset($saved_id) ? $saved_id : 0))
    407 {
    408 $_clearall = "<input type='button' name='clearallbtn' value='" . $clang->gT("Exit and Clear Survey") . "' class='clearall' "
    409 . "onclick=\"if (confirm('" . $clang->gT("Are you sure you want to clear all your responses?", 'js') . "')) {\nwindow.open('".Yii::app()->getController()->createUrl("survey/index/sid/$surveyid?move=clearall&lang=" . $s_lang);
    410
    411 if (returnGlobal('token'))
    #3
    – C:\xampp\htdocs\ls2\application\helpers\frontend_helper.php(2726): templatereplace("<meta http-equiv="content-type" content="text/html; charset=UTF-...", array(), array("thistpl" => "C:\xampp\htdocs\ls2\templates/default", "token" => null, "surveyid" => "722461", "thissurvey" => array("surveyls_survey_id" => "722461", "surveyls_language" => "en", "surveyls_title" => "LS2 Validation Samples", "surveyls_description" => "This demonstrates how Expression Manager can support dynamic val...", ...), ...), "frontend_helper[2757]")
    2721
    2722 LimeExpressionManager::StartProcessingPage();
    2723 LimeExpressionManager::StartProcessingGroup(-1, false, $surveyid); // start on welcome page
    2724
    2725 $redata = compact(array_keys(get_defined_vars()));
    2726 echo templatereplace(file_get_contents("$thistpl/startpage.pstpl"),array(),$redata,'frontend_helper[2757]');
    2727 echo "\n<form method='post' action='".Yii::app()->getController()->createUrl("/survey/index")."' id='limesurvey' name='limesurvey' autocomplete='off'>\n";
    2728
    2729 echo "\n\n<!-- START THE SURVEY -->\n";
    2730
    2731 echo templatereplace(file_get_contents("$thistpl/welcome.pstpl"),array(),$redata,'frontend_helper[2762]')."\n";
    #4
  • C:\xampp\htdocs\ls2\application\helpers\SurveyRuntimeHelper.php(241): display_first_page()
    #5
  • C:\xampp\htdocs\ls2\application\controllers\survey\index.php(674): SurveyRuntimeHelper->run("722461", array("surveyid" => "722461", "thistpl" => "C:\xampp\htdocs\ls2\templates/default", "totalquestions" => null, "thissurvey" => array("surveyls_survey_id" => "722461", "surveyls_language" => "en", "surveyls_title" => "LS2 Validation Samples", "surveyls_description" => "This demonstrates how Expression Manager can support dynamic val...", ...), ...))
    #6
  • C:\xampp\htdocs\ls2\application\controllers\survey\index.php(18): index->action()
    #7
  • C:\xampp\htdocs\ls2\framework\web\actions\CAction.php(75): index->run()
    #8
  • C:\xampp\htdocs\ls2\framework\web\CController.php(309): CAction->runWithParams(array("sid" => "722461", "newtest" => "Y", "lang" => "en"))
    #9
  • C:\xampp\htdocs\ls2\framework\web\CController.php(287): CController->runAction(index)
    #10
  • C:\xampp\htdocs\ls2\framework\web\CController.php(266): CController->runActionWithFilters(index, array())
    #11
  • C:\xampp\htdocs\ls2\framework\web\CWebApplication.php(276): CController->run("index")
    #12
  • C:\xampp\htdocs\ls2\framework\web\CWebApplication.php(135): CWebApplication->runController("survey/index/sid/722461/newtest/Y/lang/en")
    #13
  • C:\xampp\htdocs\ls2\framework\base\CApplication.php(162): CWebApplication->processRequest()
    #14
  • C:\xampp\htdocs\ls2\index.php(171): CApplication->run()
TagsNo tags attached.
Bug heat6
Complete LimeSurvey version number (& build)120624
I will donate to the project if issue is resolvedNo
Browser
Database type & versionMysql 5.3
Server OS (if known)Windows XP
Webserver software & version (if known)XAMPP
PHP Version5.3

Users monitoring this issue

There are no users monitoring this issue.

Activities

TMSWhite

TMSWhite

2012-06-22 22:09

reporter   ~19488

Also unable to preview group or preview question.

TMSWhite

TMSWhite

2012-06-22 22:20

reporter   ~19489

However, activated surveys can be tested.

c_schmitz

c_schmitz

2012-06-22 23:40

administrator   ~19498

Shnoulle this is caused by your change:

Revision: 16be365a8b43ed252a893f8bb81cb169662a5820
Author: Denis Chenu
Date: 22.06.2012 15:44:38
Message:
Fixed issue 06210 Inconsistent database after deleting a file by "clear & exit" button

Dev : review fixed issue 06226 & 06229
Dev : show clear and exit button only if token aren't used for survey with alloweditaftercompletion
Dev : test if we delete the DB line before delete it and remove the files

Modified : application/controllers/survey/index.php
Modified : application/helpers/common_helper.php
Modified : application/helpers/frontend_helper.php
Modified : application/helpers/replacements_helper.php

DenisChenu

DenisChenu

2012-06-23 12:59

developer   ~19514

Fix committed to Yii branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&amp;id=8850

c_schmitz

c_schmitz

2012-07-19 23:34

administrator   ~19841

2.00RC6 released.

Related Changesets

LimeSurvey: Yii 2bc54292

2012-06-23 03:57:32

DenisChenu

Details Diff
Fixed issue 06261 : unable to preview non-active survey, group, or question
Description
Dev : put test in replacements, maybe best is to rework Survey_dynamic::model
Affected Issues
06261
mod - application/helpers/replacements_helper.php Diff File

Issue History

Date Modified Username Field Change
2012-06-22 22:08 TMSWhite New Issue
2012-06-22 22:09 TMSWhite Note Added: 19488
2012-06-22 22:20 TMSWhite Note Added: 19489
2012-06-22 23:06 TMSWhite Severity crash => partial_block
2012-06-22 23:06 TMSWhite Summary unable to test survey (front-end) => unable to preview non-active survey, group, or question
2012-06-22 23:06 TMSWhite Additional Information Updated
2012-06-22 23:40 c_schmitz Assigned To => DenisChenu
2012-06-22 23:40 c_schmitz Status new => assigned
2012-06-22 23:40 c_schmitz Note Added: 19498
2012-06-23 12:59 DenisChenu Changeset attached => LimeSurvey Yii 2bc54292
2012-06-23 12:59 DenisChenu Note Added: 19514
2012-06-23 12:59 DenisChenu Resolution open => fixed
2012-06-23 13:44 DenisChenu Status assigned => resolved
2012-06-23 13:44 DenisChenu Fixed in Version => 2.00RC5
2012-07-19 23:34 c_schmitz Note Added: 19841
2012-07-19 23:34 c_schmitz Status resolved => closed