View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
15500 | Bug reports | Plugins | public | 2019-10-31 05:00 | 2021-03-08 19:35 |
Reporter | adamzammit | Assigned To | ollehar | ||
Priority | none | Severity | block | ||
Status | closed | Resolution | fixed | ||
Product Version | 3.19.3 | ||||
Fixed in Version | 3.25.17 | ||||
Summary | 15500: getSurveyInfo() fails with fatal error for a plugin from console when tokens table with attributes set | ||||
Description | When using the function getSurveyInfo() inside a plugin that is executed from the console AND the survey I am getting the info for has a tokens table AND has attributes set in the tokens table, I received the error: PHP Fatal error: Class 'Token_XXXXXX' not found in /var/www/html/framework/db/ar/CActiveRecord.php on line 403 If the same function was called in the plugin NOT from the console, there was no error. Also if there was no tokens table set or a tokens table set with no attributes - there was no error. I was able to track this down to the console init not importing and registering the ClassFactory. Here is my solution: In application/commands/console.php add the 3 lines indicated with "//add"
Not sure if anyone else has encountered this or is happy to test? | ||||
Tags | No tags attached. | ||||
Bug heat | 10 | ||||
Complete LimeSurvey version number (& build) | 3.19.3 | ||||
I will donate to the project if issue is resolved | No | ||||
Browser | |||||
Database type & version | MariaDb | ||||
Server OS (if known) | |||||
Webserver software & version (if known) | |||||
PHP Version | 7.2 | ||||
Hi @DenisChenu - I noticed this when working with the backupSurveyLocally plugin that I have forked from your repository on GitLab. Do you notice this bug when using your plugin? Thanks, |
|
No, because I didn't load Survey model :) When i need Survey::model : https://gitlab.com/SondagesPro/mailing/sendMailCron/blob/master/sendMailCron.php#L1422 |
|
Does the bug appear when getSurveyInfo() is called here: ? |
|
? right … i must look … but i use it on a 2.73 version … :/ |
|
@adamzammit : checked : same issue … |
|
Thanks @DenisChenu. Do you think we should add the ClassFactory code to console.php or leave it up to the plugin to load? Adam |
|
My opinion : must be loaded by core if needed … (When load Token or Response model ?) is the best. Load by plugins is a workaround … then : load directly when using console (same for all other bug/issue when using console) |
|
Please check if this bug still exists in the latest patch release. Thank you. |
|
I can confirm the issue still appears for me on the latest 3.x-LTS. I still require the modification suggested in the original post (Adding the lines to the console.php file) to avoid an error |
|
Fix committed to 3.x-LTS branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=31271 |
|
Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=31272 |
|
Thanks for the fix! |
|
LimeSurvey: 3.x-LTS e437acb9 2021-03-05 15:55 Details Diff |
Fixed issue 15500: getSurveyInfo() fails with fatal error for a plugin from console |
Affected Issues 15500 |
|
mod - application/commands/console.php | Diff File | ||
LimeSurvey: master 31709469 2021-03-05 15:55 Details Diff |
Fixed issue 15500: getSurveyInfo() fails with fatal error for a plugin from console |
Affected Issues 15500 |
|
mod - application/commands/console.php | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2019-10-31 05:00 | adamzammit | New Issue | |
2019-10-31 05:01 | adamzammit | Description Updated | |
2019-10-31 05:01 | adamzammit | Description Updated | |
2019-11-01 05:01 | adamzammit | Issue Monitored: DenisChenu | |
2019-11-01 05:02 | adamzammit | Note Added: 54299 | |
2019-11-01 05:03 | adamzammit | Issue Monitored: adamzammit | |
2019-11-01 11:21 | DenisChenu | Note Added: 54315 | |
2019-11-04 06:15 | adamzammit | Note Added: 54378 | |
2019-11-04 09:42 | DenisChenu | Note Added: 54380 | |
2019-11-05 07:15 | DenisChenu | Note Added: 54395 | |
2019-11-08 04:53 | adamzammit | Note Added: 54477 | |
2019-11-08 07:40 | DenisChenu | Note Added: 54478 | |
2021-03-03 15:09 | ollehar | Assigned To | => ollehar |
2021-03-03 15:09 | ollehar | Status | new => feedback |
2021-03-03 15:09 | ollehar | Note Added: 62662 | |
2021-03-05 02:36 | adamzammit | Note Added: 62742 | |
2021-03-05 02:36 | adamzammit | Status | feedback => assigned |
2021-03-05 14:55 | ollehar | Changeset attached | => LimeSurvey 3.x-LTS e437acb9 |
2021-03-05 14:55 | ollehar | Note Added: 62765 | |
2021-03-05 14:55 | ollehar | Resolution | open => fixed |
2021-03-05 14:56 | ollehar | Changeset attached | => LimeSurvey master 31709469 |
2021-03-05 14:56 | ollehar | Note Added: 62766 | |
2021-03-05 14:56 | ollehar | Status | assigned => resolved |
2021-03-05 14:56 | ollehar | Note Added: 62767 | |
2021-03-08 19:35 | c_schmitz | Fixed in Version | => 3.25.17 |
2021-03-08 19:35 | c_schmitz | Status | resolved => closed |
2021-08-02 17:18 | guest | Bug heat | 6 => 10 |