View Issue Details

IDProjectCategoryView StatusLast Update
16548Bug reportsPluginspublic2020-08-27 17:39
Reportereddylackmann Assigned Togabrieljenik  
PrioritynoneSeverityminor 
Status assignedResolutionopen 
Product Version4.3.6 
Summary16548: Only one Plugin menu item can be displayed when the menubar is rendered - Faulty "beforeAdminMenuRender" Events
Description

I installed two plugins that have suscribed to the "beforeAdminMenuRender" and have some menu items. But only one Menu Item is displayed.

Each activated plugins with a "beforeAdminMenuRender" event with a menu item should be rendered in the top menu bar.

Steps To Reproduce
  • Activate 2 plugins that have menu items
TagsNo tags attached.
Complete LimeSurvey version number (& build)4.3.6 + 200727
I will donate to the project if issue is resolvedNo
Sync to Zoho Project
Browser
Database & DB-VersionMysql/postgres ....
Server OS (if known)
Webserver software & version (if known)
PHP Version5.6 / 7.4

Activities

eddylackmann

eddylackmann

2020-07-30 13:32

administrator  

Plugin 0.PNG (38,299 bytes)   
Plugin 0.PNG (38,299 bytes)   
Plugin 1.PNG (44,923 bytes)   
Plugin 1.PNG (44,923 bytes)   
gabrieljenik

gabrieljenik

2020-08-24 17:11

developer   ~59595

As per the current design of the plugin system, this is not an bug but a plugin design problem.

The problem arises when a plugin sets 'extraMenus' using $oEvent->set('extraMenus', [$oNewMenu]) instead of appending: $oEvent->append('extraMenus', [$oNewMenu]).

It can be a problem that a plugin can override other plugin's menus, but it seems to be designed like that.
It is not only in respect to menus that can be overriden but with every other plugin output parameters.

So, suggested feature would be to have the plugin dispatcher to append the outputs of different plugins instead of allowing them to be oberriden.
I think that should be addressed on a different story as to properly prioritize it.

Thanks!

DenisChenu

DenisChenu

2020-08-27 17:35

developer   ~59644

The problem arises when a plugin sets 'extraMenus' using $oEvent->set('extraMenus', [$oNewMenu]) instead of appending: $oEvent->append('extraMenus', [$oNewMenu]).

Yes, know issue : more a documentation issue

So, suggested feature would be to have the plugin dispatcher to append the outputs of different plugins instead of allowing them to be oberriden.

Must allow SET whole menu too … extraMenus is an array, you can (posibiliy) add multiple menu and maybe remove men,u

My opinion : documentation issue, not code issue.

See https://manual.limesurvey.org/NewQuestionAttributes#The_event to have append as example.

DenisChenu

DenisChenu

2020-08-27 17:36

developer   ~59645

Or : https://manual.limesurvey.org/GetGlobalBasePermissions

DenisChenu

DenisChenu

2020-08-27 17:39

developer   ~59646

I think that should be addressed on a different story as to properly prioritize it.

There a starting point for prioritize in 4.X : https://github.com/LimeSurvey/LimeSurvey/commit/a313ca0f5d05aa640b70c89197f168ac7f1836ab#diff-e3eaef28f5cb03f927f51c2097f40186

Not enough (need plugin dependance like Linux services)

Issue History

Date Modified Username Field Change
2020-07-30 13:32 eddylackmann New Issue
2020-07-30 13:32 eddylackmann Status new => assigned
2020-07-30 13:32 eddylackmann Assigned To => cdorin
2020-07-30 13:32 eddylackmann File Added: Plugin 0.PNG
2020-07-30 13:32 eddylackmann File Added: Plugin 1.PNG
2020-08-20 15:24 cdorin Assigned To cdorin => gabrieljenik
2020-08-24 17:11 gabrieljenik Note Added: 59595
2020-08-27 17:35 DenisChenu Note Added: 59644
2020-08-27 17:36 DenisChenu Note Added: 59645
2020-08-27 17:39 DenisChenu Note Added: 59646