View Issue Details

IDProjectCategoryView StatusLast Update
16673Bug reportsPluginspublic2020-09-22 16:04
Reporterasshank Assigned Tocdorin  
Status assignedResolutionopen 
Product Version4.3.16 
Summary16673: afterFindSurvey is fired multiple times

The afterFindSurvey event is fired every type a Question is rendered (it seems).

I stumbled upon this, because I used a sendmail option in a plugin on the event.
And it fired a lot of emails in rapid succession (the survey contained more then 500 questions :-) ).

Steps To Reproduce


Additional Information

You should expect it to fire once, I guess

@denis: BTW should state 4.3.16 also!

TagsNo tags attached.
Complete LimeSurvey version number (& build)4.3.16
I will donate to the project if issue is resolvedNo
Sync to Zoho Project
Database & DB-VersionN.A.
Server OS (if known)Centos 7
Webserver software & version (if known)apache
PHP Version7.4




2020-09-18 11:52

reporter   ~59873

Not only after question render! The survey I tested fired 3748 times! (767 questions)



2020-09-19 18:49

developer   ~59885

Maybe we can move it to the satci part of find ?

twigreneder seems to happen a lot too.



2020-09-19 21:07

reporter   ~59887

It wil reduce processor cycles! It is massive! Who knows: renderspeed improvement?



2020-09-21 15:39

developer   ~59905

With Sample survey
Set "All in one page"

afterFindSurvey happen

  • in 3.X : 2 times
  • in 4.3.16 : 430 times

There are clearly a new issue here.

Plugin used :



2020-09-21 15:41

developer   ~59907

But more :! my 3.X version for testing have already a lot of plugins …



2020-09-21 15:46

developer   ~59910

Seems we don't use findByPk in 3.X on some function.

We must use findByPk … for Survey (and anywhere it's possible)



2020-09-21 21:19

reporter   ~59912

this issue should also be addressed to 3xLTS



2020-09-22 08:51

developer   ~59917

No : 3LTS : event happen 2 times only, no real issue in LTS. Can be improved, but still no a real issue.

Did you test my plugin ?



2020-09-22 15:34

developer   ~59925

Strange. I don't see why it is called so few times on LSv3 if the event happens afterFind.

As per the definition of the manual, I would just trigger the event manually from the survey taking side, instead of attaching it to the find method, which could be triggered from the admin side as well.

Am I right? Or am I missing something?



2020-09-22 16:04

developer   ~59926

findByPk don't throw afterFind event.
Usage of static variable.

I would just trigger the event manually from the survey taking side, instead of attaching it to the find method,

Plugin can need to update attribute each time it was loaded. Even o admin part : it don't happen a lot, 3 times for Survey settings. Currently plugin event happen in admin , stay in admin please …

Dev can control where it's call with Yii::app()->getController()->getId()


Issue History

Date Modified Username Field Change
2020-09-18 11:09 asshank New Issue
2020-09-18 11:52 asshank Note Added: 59873
2020-09-19 18:49 DenisChenu Note Added: 59885
2020-09-19 21:07 asshank Note Added: 59887
2020-09-21 15:39 DenisChenu Note Added: 59905
2020-09-21 15:41 DenisChenu Note Added: 59907
2020-09-21 15:41 DenisChenu File Added: limesurvey_survey_SampleAllInOne.lss
2020-09-21 15:41 DenisChenu Assigned To => cdorin
2020-09-21 15:41 DenisChenu Status new => assigned
2020-09-21 15:42 DenisChenu Severity minor => tweak
2020-09-21 15:46 DenisChenu Note Added: 59910
2020-09-21 21:19 bismark Note Added: 59912
2020-09-22 08:51 DenisChenu Note Added: 59917
2020-09-22 15:34 gabrieljenik Note Added: 59925
2020-09-22 16:04 DenisChenu Note Added: 59926
2020-09-22 16:04 DenisChenu File Added: Capture d’écran du 2020-09-22 16-02-13.png