View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
18367Bug reportsPluginspublic2022-09-23 16:25
Reporterbismark Assigned Toollehar  
PrioritylowSeveritycrash 
Status feedbackResolutionopen 
Product Version3.28.x 
Summary18367: Xdebug has detected a possible infinite loop
Description

In a plugins "atferPluginLoad" event I check a permission via Permission::model()->hasSurveyPermission($sid, 'labelsets', 'create') which ends up in an error: Xdebug has detected a possible infinite loop, and aborted your script with a stack depth of '256' frames

public function afterPluginLoad(): void
    {
        if (!Yii::app() instanceof LSYii_Application) {
            return;
        }

        if (strpos(Yii::app()->request->getRequestUri(), 'admin/questions/sa/view') !== false) {

            $sid = intval(Yii::app()->request->getParam('surveyid', 0));
            $canAccess = Permission::model()->hasSurveyPermission($sid, 'labelsets', 'create');
            var_dump($canAccess);
        }
}
Steps To Reproduce

Steps to reproduce

(Replace this text with detailed step-by-step instructions on how to reproduce the issue)

Expected result

(Write here what you expected to happen)

Actual result

(Write here what happened instead)

TagsNo tags attached.
Bug heat6
Complete LimeSurvey version number (& build)5.3.x
I will donate to the project if issue is resolvedNo
Browser
Database type & versionMySQL
Server OS (if known)
Webserver software & version (if known)
PHP Version8.0

Users monitoring this issue

User List There are no users monitoring this issue.

Activities

DenisChenu

DenisChenu

2022-09-21 11:26

developer   ~71865

Last edited: 2022-09-21 11:27

You plugin have a permission event ?

Else : seems better in beforeControllerAction

bismark

bismark

2022-09-22 10:24

reporter   ~71888

beforeControllerAction is ok, I use beforeAdminMenuRender now, which also solves my problem

DenisChenu

DenisChenu

2022-09-22 10:28

developer   ~71890

Plugin have Permission event ?

If not : it still a core issue (in my opinon)
If yes : plugin issue in my opinion

bismark

bismark

2022-09-22 11:51

reporter   ~71891

no, there is no further permission event defined, so it is still an issue

DenisChenu

DenisChenu

2022-09-22 12:00

developer   ~71893

You can just send the most simple plugin maybe ;)
Leave it open : other dev need to know :)

ollehar

ollehar

2022-09-23 16:24

administrator   ~71903

Last edited: 2022-09-23 16:24

Need zip file of plugin code that reproduces the issue

Issue History

Date Modified Username Field Change
2022-09-21 11:25 bismark New Issue
2022-09-21 11:26 DenisChenu Note Added: 71865
2022-09-21 11:26 DenisChenu Bug heat 0 => 2
2022-09-21 11:27 DenisChenu Note Edited: 71865
2022-09-22 10:24 bismark Note Added: 71888
2022-09-22 10:24 bismark Bug heat 2 => 4
2022-09-22 10:28 DenisChenu Note Added: 71890
2022-09-22 11:51 bismark Note Added: 71891
2022-09-22 12:00 DenisChenu Note Added: 71893
2022-09-23 16:24 ollehar Assigned To => ollehar
2022-09-23 16:24 ollehar Status new => feedback
2022-09-23 16:24 ollehar Note Added: 71903
2022-09-23 16:24 ollehar Bug heat 4 => 6
2022-09-23 16:24 ollehar Note Edited: 71903
2022-09-23 16:25 ollehar Priority none => low