View Issue Details

This bug affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
09310Bug reportsOtherpublic2014-10-20 13:11
Reportermfaber Assigned Toc_schmitz  
PrioritynormalSeveritypartial_block 
Status closedResolutionfixed 
Product Version2.06+ 
Summary09310: PHP warning on DB upgrade:: Undefined variable: oLang
Description

Upgraded to the latest 2.06 git version.
After clicking on yes for the db upgrade, there's a PHP warning (see trace in additional info).

PHP notice

Undefined variable: oLang

E:\survey\htdocs\github\LimeSurvey\application\helpers\update\updatedb_helper.php(27)

15 // There will be a file for each database (accordingly named to the dbADO scheme)
16 // where based on the current database version the database is upgraded
17 // For this there will be a settings table which holds the last time the database was upgraded
18
19 function db_upgrade_all($iOldDBVersion) {
20 /// This function does anything necessary to upgrade
21 /// older versions to match current functionality
22 global $modifyoutput;
23 Yii::app()->loadHelper('database');
24
25 $sUserTemplateRootDir = Yii::app()->getConfig('usertemplaterootdir');
26 $sStandardTemplateRootDir = Yii::app()->getConfig('standardtemplaterootdir');
27 echo str_pad(gT('The LimeSurvey database is being upgraded').' ('.date('Y-m-d H:i:s').')',14096).".<br /><br />". $oLang->gT('Please be patient...')."<br /><br />\n";
28
29 $sDBDriverName=setsDBDriverName();
30 setVarchar($sDBDriverName);
31 $sVarchar = Yii::app()->getConfig('varchar');
32 $sAutoIncrement = Yii::app()->getConfig('autoincrement');
33
34 $oDB = Yii::app()->getDb();
35 $oDB->schemaCachingDuration=0; // Deactivate schema caching
36 $oTransaction = $oDB->beginTransaction();
37 try
38 {
39 if ($iOldDBVersion < 111)

Additional Information

PHP notice

Undefined variable: oLang

E:\survey\htdocs\github\LimeSurvey\application\helpers\update\updatedb_helper.php(27)

15 // There will be a file for each database (accordingly named to the dbADO scheme)
16 // where based on the current database version the database is upgraded
17 // For this there will be a settings table which holds the last time the database was upgraded
18
19 function db_upgrade_all($iOldDBVersion) {
20 /// This function does anything necessary to upgrade
21 /// older versions to match current functionality
22 global $modifyoutput;
23 Yii::app()->loadHelper('database');
24
25 $sUserTemplateRootDir = Yii::app()->getConfig('usertemplaterootdir');
26 $sStandardTemplateRootDir = Yii::app()->getConfig('standardtemplaterootdir');
27 echo str_pad(gT('The LimeSurvey database is being upgraded').' ('.date('Y-m-d H:i:s').')',14096).".<br /><br />". $oLang->gT('Please be patient...')."<br /><br />\n";
28
29 $sDBDriverName=setsDBDriverName();
30 setVarchar($sDBDriverName);
31 $sVarchar = Yii::app()->getConfig('varchar');
32 $sAutoIncrement = Yii::app()->getConfig('autoincrement');
33
34 $oDB = Yii::app()->getDb();
35 $oDB->schemaCachingDuration=0; // Deactivate schema caching
36 $oTransaction = $oDB->beginTransaction();
37 try
38 {
39 if ($iOldDBVersion < 111)

Stack Trace
#0

E:\survey\htdocs\github\LimeSurvey\application\helpers\update\update_helper.php(32): db_upgrade_all(177)

27 if(isset($subaction) && $subaction=="yes")
28 {
29 echo Yii::app()->getController()->_getAdminHeader();
30 echo "<div style='width:90%; padding:1% 5%;background-color:#eee;'>";
31 Yii::app()->loadHelper('update/updatedb');
32 $result=db_upgrade_all(intval($currentDBVersion));
33 if ($result)
34 {
35 $data = "<br />".sprintf(gT("Database has been successfully upgraded to version %s"),$dbversionnumber);
36 $data .= "<br /><a href='".Yii::app()->getController()->createUrl("/admin")."'>".gT("Back to main menu")."</a></div>";
37 }

#1

E:\survey\htdocs\github\LimeSurvey\application\controllers\admin\update.php(599): CheckForDBUpgrades("yes")

594 function db($continue = null)
595 {
596 Yii::app()->loadHelper("update/update");
597 if(isset($continue) && $continue=="yes")
598 {
599 $aViewUrls['output'] = CheckForDBUpgrades($continue);
600 updateCheck();
601 $aData['display']['header'] = false;
602 }
603 else
604 {

#2
unknown(0): update->db("yes")
#3
+
E:\survey\htdocs\github\LimeSurvey\framework\web\actions\CAction.php(108): ReflectionMethod->invokeArgs(update, array("yes"))
#4

E:\survey\htdocs\github\LimeSurvey\application\core\Survey_Common_Action.php(99): CAction->runWithParamsInternal(update, ReflectionMethod, array("continue" => "yes", "sa" => "db"))

094 $oMethod = new ReflectionMethod($this, $sDefault);
095 }
096
097 // We're all good to go, let's execute it
098 // runWithParamsInternal would automatically get the parameters of the method and populate them as required with the params
099 return parent::runWithParamsInternal($this, $oMethod, $params);
100 }
101
102 /*
103
Some functions have different parameters, which are just an alias of the
104 * usual parameters we're getting in the url. This function just populates

#5
+
E:\survey\htdocs\github\LimeSurvey\framework\web\CController.php(308): Survey_Common_Action->runWithParams(array("continue" => "yes", "sa" => "db"))
#6
+
E:\survey\htdocs\github\LimeSurvey\framework\web\CController.php(286): CController->runAction(update)
#7
+
E:\survey\htdocs\github\LimeSurvey\framework\web\CController.php(265): CController->runActionWithFilters(update, array())
#8
+
E:\survey\htdocs\github\LimeSurvey\application\controllers\AdminController.php(164): CController->run("update")
#9
+
E:\survey\htdocs\github\LimeSurvey\framework\web\CWebApplication.php(282): AdminController->run("update")
#10
+
E:\survey\htdocs\github\LimeSurvey\framework\web\CWebApplication.php(141): CWebApplication->runController("admin/update/sa/db")
#11
+
E:\survey\htdocs\github\LimeSurvey\framework\base\CApplication.php(180): CWebApplication->processRequest()
#12
+
E:\survey\htdocs\github\LimeSurvey\index.php(200): CApplication->run()
2014-10-17 22:17:24 Apache/2.4.4 (Win32) OpenSSL/0.9.8y PHP/5.4.19 Yii Framework/1.1.14
Application Log
Timestamp Level Category Message
22:17:23.330522 trace system.CModule

Loading "log" application component

22:17:23.330522 trace system.CModule

Loading "request" application component

22:17:23.346122 trace system.CModule

Loading "assetManager" application component

22:17:23.361721 trace system.db.ar.CActiveRecord

Plugin.findAllByAttributes()

22:17:23.361721 trace system.CModule

Loading "db" application component

22:17:23.361721 trace system.db.CDbConnection

Opening DB connection

22:17:24.406923 trace system.CModule

Loading "cache" application component

22:17:24.422523 trace system.db.CDbCommand

Querying SQL: SHOW FULL COLUMNS FROM lime_plugins

22:17:24.422523 trace system.db.CDbCommand

Querying SQL: SHOW CREATE TABLE lime_plugins

22:17:24.422523 trace system.db.CDbCommand

Querying SQL: SELECT * FROM lime_plugins t WHERE t.active=:yp0

22:17:24.438123 trace system.CModule

Loading "urlManager" application component

22:17:24.453723 trace system.CModule

Loading "session" application component

22:17:24.469324 trace system.db.CDbCommand

Querying SQL: SHOW FULL COLUMNS FROM lime_settings_global

22:17:24.469324 trace system.db.CDbCommand

Querying SQL: SHOW CREATE TABLE lime_settings_global

22:17:24.469324 trace system.db.ar.CActiveRecord

SettingGlobal.findAll()

22:17:24.469324 trace system.db.CDbCommand

Querying SQL: SELECT * FROM lime_settings_global t

22:17:24.531723 trace system.CModule

Loading "bootstrap" application component

22:17:24.531723 trace system.CModule

Loading "clientScript" application component

22:17:24.531723 trace system.CModule

Loading "messages" application component

22:17:24.531723 trace system.CModule

Loading "user" application component

22:17:24.531723 trace system.db.CDbCommand

Querying SQL: SHOW FULL COLUMNS FROM lime_surveys

22:17:24.531723 trace system.db.CDbCommand

Querying SQL: SHOW CREATE TABLE lime_surveys

22:17:24.547323 trace system.CModule

Loading "widgetFactory" application component

22:17:24.547323 error php

Undefined variable: oLang
(E:\survey\htdocs\github\LimeSurvey\application\helpers\update\updatedb_helper.php:27)
Stack trace:
#0 unknown(0): update->db()
#1
E:\survey\htdocs\github\LimeSurvey\framework\web\actions\CAction.php(108):
ReflectionMethod->invokeArgs()
#2
E:\survey\htdocs\github\LimeSurvey\application\core\Survey_Common_Action.php(99):
update->runWithParamsInternal()
#3 E:\survey\htdocs\github\LimeSurvey\framework\web\CController.php(308):
update->runWithParams()
#4 E:\survey\htdocs\github\LimeSurvey\framework\web\CController.php(286):
AdminController->runAction()
#5 E:\survey\htdocs\github\LimeSurvey\framework\web\CController.php(265):
AdminController->runActionWithFilters()
#6
E:\survey\htdocs\github\LimeSurvey\application\controllers\AdminController.php(164):
AdminController->run()
#7
E:\survey\htdocs\github\LimeSurvey\framework\web\CWebApplication.php(282):
AdminController->run()
#8
E:\survey\htdocs\github\LimeSurvey\framework\web\CWebApplication.php(141):
LSYii_Application->runController()
#9 E:\survey\htdocs\github\LimeSurvey\framework\base\CApplication.php(180):
LSYii_Application->processRequest()
#10 E:\survey\htdocs\github\LimeSurvey\index.php(200):
LSYii_Application->run()
REQUEST_URI=/github/limesurvey/index.php/admin/update/sa/db/continue/yes

22:17:24.547323 trace system.CModule

Loading "errorHandler" application component

TagsNo tags attached.
Bug heat4
Complete LimeSurvey version number (& build)141017
I will donate to the project if issue is resolvedNo
BrowserFF
Database type & versionMySQL 5.0.10
Server OS (if known)Win7
Webserver software & version (if known)Apache 2.4.7
PHP VersionPhP 5.4.19

Users monitoring this issue

There are no users monitoring this issue.

Activities

mfaber

mfaber

2014-10-19 20:14

reporter   ~30820

Sorry to reopen this but I cannot see that this has been fixed. Besides cLang there's also oLang in the updatedb_helper.php. Maybe this needs to be removed as well?

c_schmitz

c_schmitz

2014-10-20 13:11

administrator   ~30821

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

c_schmitz

c_schmitz

2014-10-20 13:11

administrator   ~30822

k, thank you.

Related Changesets

LimeSurvey: 2.06 8436716d

2014-10-20 11:10:58

c_schmitz

Details Diff
Fixed issue 09310: PHP warning on DB upgrade:: Undefined variable: oLang Affected Issues
09310
mod - application/config/internal.php Diff File
mod - application/controllers/admin/useraction.php Diff File
mod - application/helpers/update/updatedb_helper.php Diff File

Issue History

Date Modified Username Field Change
2014-10-17 22:21 mfaber New Issue
2014-10-17 22:21 mfaber Status new => assigned
2014-10-17 22:21 mfaber Assigned To => c_schmitz
2014-10-17 22:21 mfaber Issue generated from: 09302
2014-10-17 22:25 mfaber Issue cloned: 09311
2014-10-17 22:25 mfaber LimeSurvey build number OR git commit ID 141014 => 141017
2014-10-17 22:25 mfaber Additional Information Updated
2014-10-19 11:56 c_schmitz Status assigned => closed
2014-10-19 11:56 c_schmitz Resolution open => fixed
2014-10-19 20:14 mfaber Note Added: 30820
2014-10-19 20:14 mfaber Status closed => feedback
2014-10-19 20:14 mfaber Resolution fixed => reopened
2014-10-20 13:11 c_schmitz Changeset attached => LimeSurvey 2.06 8436716d
2014-10-20 13:11 c_schmitz Note Added: 30821
2014-10-20 13:11 c_schmitz Note Added: 30822
2014-10-20 13:11 c_schmitz Status feedback => closed
2014-10-20 13:11 c_schmitz Resolution reopened => fixed