Syxton / moodle-block_massaction

THE OFFICIAL Mass Actions block for Moodle 3.9 and beyond
9 stars 14 forks source link

Duplicate Mass Action blocks fail without notifying user #42

Closed markstaylor closed 2 years ago

markstaylor commented 2 years ago

Although users should not be able to add a second Mass Action block, it can happen in some circumstances. When it does, the second block is displayed as normal, but does not function. Users may try to use the non-functional block and conclude that the plugin is broken altogether.

It would be better to detect when a duplicate block has been added and display a message to the user in it explaining that it is a duplicate and should be deleted.

PhMemmel commented 2 years ago

Thank you for reporting. The block definitely is not implemented to work if loaded twice on a page. I actually trusted the moodle block api to avoid such cases. Could you please describe how to get two blocks on the same site, so we can test these cases? Thanks in advance!

markstaylor commented 2 years ago

The easiest way is to open a course with no Mass Action blocks in two browser tabs, and add a block from each.

PhMemmel commented 2 years ago

Lol got it, thanks. Well... I'd say this should be fixed by moodle, but I'll see if I can add a check for that edge case.