View Issue Details

IDProjectCategoryView StatusLast Update
13888Bug reports[All Projects] _ Unknownpublic2018-09-14 09:06
ReportercaseylucasAssigned ToDenisChenu 
PrioritynoneSeverityminor 
Status resolvedResolutionfixed 
Product Version3.13.x 
Target VersionFixed in Version3.14.x 
Summary13888: unable to run db migration if using CRedisCache
Description

When performing a db migration via:

cd /var/www/html/
php application/commands/console.php updatedb

I received this msg:
CException: CRedisCache and its behaviors do not have a method or closure named "gc". in /var/www/html/framework/base/CComponent.php:266

This change fixes the bug:

--- a/base/application/helpers/update/updatedb_helper.php
+++ b/base/application/helpers/update/updatedb_helper.php
@@ -2319,7 +2319,10 @@ function db_upgrade_all($iOldDBVersion, $bSilent = false)
if (!(defined('YII_DEBUG') && YII_DEBUG)) {
Yii::app()->cache->flush();
// NB: CDummyCache does not have a gc method (used if debug > 0).

  • Yii::app()->cache->gc();
  • // CRedisCache does not have gc method. Verify method exists before calling.
  • if (method_exists(Yii::app()->cache, 'gc')) {
  • Yii::app()->cache->gc();
  • }
    }

    // Inform superadmin about update

Steps To Reproduce

Enable CRedisCache when performing a dbmigration. Note that a db migration must be needed.

Additional Information

See also: https://bugs.limesurvey.org/view.php?id=13744

TagsNo tags attached.
Complete LimeSurvey version number (& build)3.13.2+180709
I will donate to the project if issue is resolvedNo
Browser
Database & DB-VersionPostgres 349
Operating System (Server)linux
Webserver software & versionFPM
PHP Version7.2

Activities

DenisChenu

DenisChenu

2018-07-20 11:32

developer   ~48542

Last edited: 2018-07-20 11:32

View 2 revisions

Maybe

if (method_exists(Yii::app()->cache, 'flush')) {
    Yii::app()->cache->flush();
}
if (method_exists(Yii::app()->cache, 'gc')) {
    Yii::app()->cache->gc();
}

Directly ? Not only for DummyCache or with gs, but : test if the 2 methods exist for all cache :)

maybe you can make a pull request ?

caseylucas

caseylucas

2018-08-20 18:10

reporter   ~48830

PR: https://github.com/LimeSurvey/LimeSurvey/pull/1111

caseylucas

caseylucas

2018-09-13 17:55

reporter   ~49026

Is there any update on this issue? Anything I can do to help?

DenisChenu

DenisChenu

2018-09-14 09:05

developer   ~49032

Arg … make an error on number …
Merged

Related Changesets

LimeSurvey: master c0ef15f5

2018-09-14 09:03:41

Casey Lucas


Committer: user70560 Details Diff
Fixed issue 13982 : (partial) some existing Yii cacche can not be used

Dev: test existing method before use it.
mod - application/helpers/update/updatedb_helper.php Diff File

Issue History

Date Modified Username Field Change
2018-07-20 04:18 caseylucas New Issue
2018-07-20 11:32 DenisChenu Note Added: 48542
2018-07-20 11:32 DenisChenu Note Edited: 48542 View Revisions
2018-08-20 18:10 caseylucas Note Added: 48830
2018-09-13 17:55 caseylucas Note Added: 49026
2018-09-14 09:05 DenisChenu Note Added: 49032
2018-09-14 09:05 DenisChenu Assigned To => DenisChenu
2018-09-14 09:05 DenisChenu Status new => resolved
2018-09-14 09:05 DenisChenu Resolution open => fixed
2018-09-14 09:05 DenisChenu Fixed in Version => 3.14.x
2018-09-14 09:06 DenisChenu Changeset attached => LimeSurvey master c0ef15f5