View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
11302 | Bug reports | Plugins | public | 2016-05-31 00:09 | 2016-06-03 14:46 |
Reporter | DenisChenu | Assigned To | |||
Priority | none | Severity | minor | ||
Status | closed | Resolution | fixed | ||
Product Version | 2.50.x | ||||
Summary | 11302: Unable to use TokenDynamic or SurveyDynamic in cron event (or command) | ||||
Description | When try to use SurveyDynamic or TokenDynamic model in cron event : receive | ||||
Steps To Reproduce | Test included plugin | ||||
Additional Information | COmplete error Due to usage of App()->user in model (then $_SESSION) I send a pull request for this | ||||
Tags | No tags attached. | ||||
Attached Files | testToken.php (1,219 bytes)
<?php /** * testToken * * @author Denis Chenu <denis@sondages.pro> * @copyright 2016 Denis Chenu <http://www.sondages.pro> * @license LPRAB (WTFPL) * @version 0.0.1 * * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * Do What The Fuck You Want to Public License for more details. */ class testToken extends \ls\pluginmanager\PluginBase { static protected $description = 'Bug report plugin'; static protected $name = 'testToken'; /** * Add function to be used in cron event */ public function init() { $this->subscribe('cron','countToken'); } public function countToken() { $oSurveys=Survey::model()->findAll( "active = 'Y'" ); Yii::import('application.helpers.common_helper', true); if($oSurveys) { foreach ($oSurveys as $oSurvey) { $nbResponse=SurveyDynamic::model($oSurvey->sid)->count(); echo "Survey {$oSurvey->sid} have {$nbResponse} responses\n"; } } } } | ||||
Bug heat | 4 | ||||
Complete LimeSurvey version number (& build) | 20160530 | ||||
I will donate to the project if issue is resolved | No | ||||
Browser | not relevant | ||||
Database type & version | not relevant | ||||
Server OS (if known) | not relevant | ||||
Webserver software & version (if known) | not relevant | ||||
PHP Version | not relevant | ||||
Plugin name is testToken, but use only Survey |
|
https://github.com/LimeSurvey/LimeSurvey/pull/499 https://github.com/LimeSurvey/LimeSurvey/pull/499/commits/293ee251eaa87bcd1d1887e4ce7f4d66a5bca9e6 replace $_SESSION usage by global |
|
Version 2.50 Build 160603 released |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2016-05-31 00:09 | DenisChenu | New Issue | |
2016-05-31 00:09 | DenisChenu | File Added: testToken.php | |
2016-05-31 00:10 | DenisChenu | Note Added: 39033 | |
2016-05-31 00:17 | DenisChenu | Note Added: 39034 | |
2016-06-03 11:20 |
|
Status | new => resolved |
2016-06-03 11:20 |
|
Resolution | open => fixed |
2016-06-03 11:20 |
|
Assigned To | => LouisGac |
2016-06-03 14:46 | c_schmitz | Note Added: 39185 | |
2016-06-03 14:46 | c_schmitz | Status | resolved => closed |