View Issue Details

IDProjectCategoryView StatusLast Update
16548Bug reportsPluginspublic2021-04-28 20:16
Reportereddylackmann Assigned Togabrieljenik  
PrioritynoneSeverityminor 
Status closedResolutionno change required 
Product Version4.3.6 
Summary16548: Only one Plugin menu item can be displayed when the menubar is rendered - Faulty "beforeAdminMenuRender" Events
DescriptionI 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
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

manager   ~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)
gabrieljenik

gabrieljenik

2021-04-28 18:12

manager   ~64174

@ollehar @c_shmitz Is there something to do here? Should we make menus to always be appended instead having the possibility overriding them?
DenisChenu

DenisChenu

2021-04-28 18:19

developer   ~64175

It's issue in plugin ?

If a plugin override : it's a plugin issue, not a core issue.

If for this evant we don't have append : it's a core issue.

For example : any plugin can disable ALL question attribute (and some can want to disable some attribute).
DenisChenu

DenisChenu

2021-04-28 18:19

developer   ~64176

Need plugin code to know :)
ollehar

ollehar

2021-04-28 18:21

administrator   ~64177

Last edited: 2021-04-28 18:22

View 2 revisions

Plugin author need to use append() instead of set() on the event data. Should work then.
DenisChenu

DenisChenu

2021-04-28 20:16

developer   ~64179

No change required ;)

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
2021-04-28 18:12 gabrieljenik Note Added: 64174
2021-04-28 18:19 DenisChenu Note Added: 64175
2021-04-28 18:19 DenisChenu Note Added: 64176
2021-04-28 18:21 ollehar Note Added: 64177
2021-04-28 18:22 ollehar Note Edited: 64177 View Revisions
2021-04-28 19:27 gabrieljenik Status assigned => closed
2021-04-28 19:27 gabrieljenik Resolution open => fixed
2021-04-28 20:16 DenisChenu Resolution fixed => no change required
2021-04-28 20:16 DenisChenu Description Updated View Revisions
2021-04-28 20:16 DenisChenu Note Added: 64179