View Issue Details

This bug affects 1 person(s).
 2
IDProjectCategoryView StatusLast Update
18475Bug reportsPluginspublic2024-11-14 10:39
ReporterDenisChenu Assigned To 
PrioritynoneSeverityminor 
Status newResolutionopen 
Product Version5.4.x 
Summary18475: 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 reproduce

Import addScriptToQuestion plugin (dev version) https://gitlab.com/SondagesPro/QuestionSettingsType/addScriptToQuestion/-/tree/dev_LSissue
Activate
Set debug to 1
Preview survey
See result
Compare with 3.X

Expected result

Event happen one time (since it's needed only one time)

Actual result

Happen a lot of time

TagsNo tags attached.
Attached Files
3X_1times.png (135,021 bytes)
5X_122times.png (33,010 bytes)   
5X_122times.png (33,010 bytes)   
Bug heat2
Complete LimeSurvey version number (& build)5.4.9
I will donate to the project if issue is resolvedNo
Browsernot relevant
Database type & versionnot relevant
Server OS (if known)not relevant
Webserver software & version (if known)not relevant
PHP Versionnot relevant

Relationships

related to 19591 new Bug reports Multiple call of question_attribute for single question (public surey) 

Users monitoring this issue

There are no users monitoring this issue.

Activities

DenisChenu

DenisChenu

2022-11-09 10:30

developer   ~72651

In 3.X : core + plugin was set in a static array
In 5. core + plugin are not in static array

Unsure about QuetsinTheme :
maybe

  • core in static
  • newQuestionAttributes event : plugin in static
  • QuestionTheme update static array

And a new feature with newQuestionThemeAttributes but think we don't really need it

DenisChenu

DenisChenu

2022-11-09 11:28

developer   ~72652

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

DenisChenu

DenisChenu

2024-03-12 18:39

developer   ~79782

Happen 28 times with 4 questions

DenisChenu

DenisChenu

2024-06-07 12:08

developer   ~80256

Remind : one time for 3.X

Issue History

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