View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 18475 | Bug reports | Plugins | public | 2022-11-09 10:28 | 2026-10-26 17:53 |
| Reporter | DenisChenu | Assigned To | c_schmitz | ||
| Priority | none | Severity | minor | ||
| Status | resolved | Resolution | fixed | ||
| Product Version | 5.4.x | ||||
| Summary | 18475: Multiple event newQuestionAttributes happen | ||||
| Description | I you have a plugin with newQuestionAttributes : it happen for each quetsion loaded (and $this->event->get('questionAttributes') | ||||
| Steps To Reproduce | Steps to reproduceImport addScriptToQuestion plugin (dev version) https://gitlab.com/SondagesPro/QuestionSettingsType/addScriptToQuestion/-/tree/dev_LSissue Expected resultEvent happen one time (since it's needed only one time) Actual resultHappen a lot of time | ||||
| Tags | No tags attached. | ||||
| Attached Files | |||||
| Bug heat | 4 | ||||
| Complete LimeSurvey version number (& build) | 5.4.9 | ||||
| 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 | ||||
| Git branch / Pull Request URL | N/A | ||||
| related to | 19591 | new | Bug reports | Multiple call of question_attribute for single question (public surey) |
|
In 3.X : core + plugin was set in a static array Unsure about QuetsinTheme :
And a new feature with newQuestionThemeAttributes but think we don't really need it |
|
|
Unsure related : Get : Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 20480 bytes) in E:\WebSite\limesurvey\application\models\services\QuestionAttributeHelper.php on line 35 Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 81920 bytes) in E:\WebSite\limesurvey\third_party\yiisoft\yii\framework\logging\CLogger.php on line 15 I deactivate all plugins and try to import again |
|
|
Happen 28 times with 4 questions |
|
|
Remind : one time for 3.X |
|
|
Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=41084 |
|
|
LimeSurvey: master 04019bc8 2026-10-26 17:51 Details Diff |
Fixed issue 18475: Plugins adding question settings were run again for every question shown, slowing down survey and admin pages Dev The newQuestionAttributes event is dispatched once per request, and again only when its subscriptions change (new PluginManager::getSubscriptions()); PluginQuestionAttributeProvider uses QuestionAttribute::getOwnQuestionAttributesViaPlugin() instead of its own dispatch |
Affected Issues 18475 |
|
| mod - application/libraries/PluginManager/PluginManager.php | Diff File | ||
| mod - application/models/QuestionAttribute.php | Diff File | ||
| mod - application/models/services/PluginQuestionAttributeProvider.php | Diff File | ||
| mod - tests/data/plugins/NewQuestionAttributesPlugin.php | Diff File | ||
| mod - tests/unit/models/QuestionAttributeTest.php | Diff File | ||
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2022-11-09 10:28 | DenisChenu | New Issue | |
| 2022-11-09 10:28 | DenisChenu | File Added: 3X_1times.png | |
| 2022-11-09 10:28 | DenisChenu | File Added: 5X_122times.png | |
| 2022-11-09 10:30 | DenisChenu | Note Added: 72651 | |
| 2022-11-09 10:30 | DenisChenu | Bug heat | 0 => 2 |
| 2022-11-09 11:28 | DenisChenu | Note Added: 72652 | |
| 2024-03-12 18:39 | DenisChenu | Note Added: 79782 | |
| 2024-06-07 12:08 | DenisChenu | Relationship added | related to 19591 |
| 2024-06-07 12:08 | DenisChenu | Note Added: 80256 | |
| 2026-10-26 17:53 | c_schmitz | Changeset attached | => LimeSurvey master 04019bc8 |
| 2026-10-26 17:53 | c_schmitz | Note Added: 86873 | |
| 2026-10-26 17:53 | c_schmitz | Assigned To | => c_schmitz |
| 2026-10-26 17:53 | c_schmitz | Status | new => resolved |
| 2026-10-26 17:53 | c_schmitz | Resolution | open => fixed |
| 2026-10-26 17:53 | c_schmitz | Bug heat | 2 => 4 |