View Issue Details

This bug affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
06077Bug reportsSurvey takingpublic2012-05-28 15:12
ReporterTMSWhite Assigned Toc_schmitz  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version2.00RC1 
Fixed in Version2.00RC2 
Summary06077: PDOException: SQLSTATE[42S02]: Base table or view not found
Description

When list survey, get this message:

( ! ) PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'ls_git_yii.lime_tokens_458118' doesn't exist in C:\xampp\htdocs\git\limesurvey_yii\framework\db\CDbCommand.php on line 497 Call Stack #TimeMemoryFunctionLocation 10.0005356256{main}( )..\index.php:0 20.02292021720CApplication->run( )..\index.php:171 30.02302021720CWebApplication->processRequest( )..\CApplication.php:162 40.02342022144CWebApplication->runController( )..\CWebApplication.php:135 50.190913574480AdminController->run( )..\CWebApplication.php:276 60.233613663048CController->run( )..\AdminController.php:150 70.245114710360CController->runActionWithFilters( )..\CController.php:266 80.245114710360CController->runAction( )..\CController.php:287 90.245214710360Survey_Common_Action->runWithParams( )..\CController.php:309 100.245414715760CAction->runWithParamsInternal( )..\Survey_Common_Action.php:82 110.245414716568ReflectionMethod->invokeArgs( )..\CAction.php:107 120.245414716592SurveyAdmin->view( )..\CAction.php:107 130.245514717536SurveyAdmin->_renderWrappedTemplate( )..\surveyadmin.php:243 140.245614717864Survey_Common_Action->_renderWrappedTemplate( )..\surveyadmin.php:1639 150.490516251032LimeExpressionManager::StartProcessingPage( )..\Survey_Common_Action.php:210 160.491316328400LimeExpressionManager->setVariableAndTokenMappingsForExpressionManager( )..\em_manager_helper.php:2801 170.599717348736GetAttributeFieldNames( )..\em_manager_helper.php:2390 180.599817348800CDbSchema->getTable( )..\common_helper.php:5242 190.599817348912CMysqlSchema->loadTable( )..\CDbSchema.php:104 200.599917349728CMysqlSchema->findColumns( )..\CMysqlSchema.php:120 210.599917350736CDbCommand->queryAll( )..\CMysqlSchema.php:160 220.600017351112CDbCommand->queryInternal( )..\CDbCommand.php:390 230.600117352592PDOStatement->execute( )..\CDbCommand.php:497 ( ! ) CDbException: CDbCommand failed to execute the SQL statement: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'ls_git_yii.lime_tokens_458118' doesn't exist. The SQL statement executed was: SHOW COLUMNS FROM lime_tokens_458118 in C:\xampp\htdocs\git\limesurvey_yii\framework\db\CDbCommand.php on line 528 Call Stack #TimeMemoryFunctionLocation 10.0005356256{main}( )..\index.php:0 20.02292021720CApplication->run( )..\index.php:171 30.02302021720CWebApplication->processRequest( )..\CApplication.php:162 40.02342022144CWebApplication->runController( )..\CWebApplication.php:135 50.190913574480AdminController->run( )..\CWebApplication.php:276 60.233613663048CController->run( )..\AdminController.php:150 70.245114710360CController->runActionWithFilters( )..\CController.php:266 80.245114710360CController->runAction( )..\CController.php:287 90.245214710360Survey_Common_Action->runWithParams( )..\CController.php:309 100.245414715760CAction->runWithParamsInternal( )..\Survey_Common_Action.php:82 110.245414716568ReflectionMethod->invokeArgs( )..\CAction.php:107 120.245414716592SurveyAdmin->view( )..\CAction.php:107 130.245514717536SurveyAdmin->_renderWrappedTemplate( )..\surveyadmin.php:243 140.245614717864Survey_Common_Action->_renderWrappedTemplate( )..\surveyadmin.php:1639 150.490516251032LimeExpressionManager::StartProcessingPage( )..\Survey_Common_Action.php:210 160.491316328400LimeExpressionManager->setVariableAndTokenMappingsForExpressionManager( )..\em_manager_helper.php:2801 170.599717348736GetAttributeFieldNames( )..\em_manager_helper.php:2390 180.599817348800CDbSchema->getTable( )..\common_helper.php:5242 190.599817348912CMysqlSchema->loadTable( )..\CDbSchema.php:104 200.599917349728CMysqlSchema->findColumns( )..\CMysqlSchema.php:120 210.599917350736CDbCommand->queryAll( )..\CMysqlSchema.php:160

Steps To Reproduce

list any survey - active or inactive

TagsNo tags attached.
Bug heat4
Complete LimeSurvey version number (& build)120501
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

c_schmitz

c_schmitz

2012-05-10 00:38

administrator   ~18650

What do you mean by 'list' ?

TMSWhite

TMSWhite

2012-05-10 13:36

reporter   ~18657

selecting a survey from the list of surveys so that you can do anything with it - e.g. view/edit survey, group, or question-level details.

c_schmitz

c_schmitz

2012-05-10 14:04

administrator   ~18659

Sorry, no problems here. Is your database maybe corrupted?

c_schmitz

c_schmitz

2012-05-13 08:37

administrator   ~18726

Can you provide anymore info or your database, maybe?

TMSWhite

TMSWhite

2012-05-13 14:44

reporter   ~18727

The core problem is this function in common_helper.php:

function GetAttributeFieldNames($surveyid,$filter=true)
{
if (!$table = Yii::app()->db->schema->getTable('{{tokens_'.$surveyid . '}}'))
return Array();
if ($filter)
{
return array_filter(array_keys($table->columns), 'filterForAttributes');
}
return array_keys($table->columns);
}

It needs to check whether the tokens_sid table exists before doing the query, otherwise you get the error I listed.

c_schmitz

c_schmitz

2012-05-13 19:40

administrator   ~18728

I would argue why would someone call this function at all if the token table does not exist?
As said, since I cannot reproduce this, so maybe your database would help?

TMSWhite

TMSWhite

2012-05-14 03:43

reporter   ~18729

This function is called by EM (among other) when it sets the variable and token mapping values. This was a bug fix from several weeks back where users asked that it only pre-declare real token values rather than ATTRIBUTE_1 - ATTRIBUTE_100.

I don't know Yii well enough to know how to have it check whether a table exists; but that would solve the problem.

c_schmitz

c_schmitz

2012-05-15 21:34

administrator   ~18771

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

c_schmitz

c_schmitz

2012-05-28 15:12

administrator   ~18959

Version 2.00RC2 released.

Related Changesets

LimeSurvey: Yii 9fddbd80

2012-05-15 12:34:21

c_schmitz

Details Diff
Fixed issue 06077: Error on listing surveys Affected Issues
06077
mod - application/helpers/common_helper.php Diff File

Issue History

Date Modified Username Field Change
2012-05-09 18:05 TMSWhite New Issue
2012-05-10 00:38 c_schmitz Note Added: 18650
2012-05-10 12:24 c_schmitz Assigned To => c_schmitz
2012-05-10 12:24 c_schmitz Status new => feedback
2012-05-10 13:36 TMSWhite Note Added: 18657
2012-05-10 13:36 TMSWhite Status feedback => assigned
2012-05-10 14:04 c_schmitz Note Added: 18659
2012-05-13 08:37 c_schmitz Note Added: 18726
2012-05-13 08:37 c_schmitz Status assigned => feedback
2012-05-13 14:44 TMSWhite Note Added: 18727
2012-05-13 14:44 TMSWhite Status feedback => assigned
2012-05-13 19:40 c_schmitz Note Added: 18728
2012-05-14 03:43 TMSWhite Note Added: 18729
2012-05-15 21:34 c_schmitz Status assigned => resolved
2012-05-15 21:34 c_schmitz Fixed in Version => 2.00RC2
2012-05-15 21:34 c_schmitz Resolution open => fixed
2012-05-15 21:34 c_schmitz Changeset attached => LimeSurvey Yii 9fddbd80
2012-05-15 21:34 c_schmitz Note Added: 18771
2012-05-28 15:12 c_schmitz Note Added: 18959
2012-05-28 15:12 c_schmitz Status resolved => closed