jonof / moodle-block_completion_progress

A time management tool for students using activity completion
https://moodle.org/plugins/block_completion_progress
GNU General Public License v3.0
17 stars 65 forks source link

Block config option is not set properly when group is deleted #111

Open djarran opened 3 months ago

djarran commented 3 months ago

Describe the bug / Steps to Reproduce:

  1. An instance of the block is set to only be visible for a certain group, i.e. Group A.
  2. Group A is deleted
  3. Navigating to the edit_form page shows that it is now visible for 'All participants', but it is still only visible to 'Group A' when decoding the configdata for the block instance.

Expected behaviour: The 'Visible only to group or grouping' setting should now show 'Unknown group' or some other alert should be shown in the edit_form page.

Potential solution: Showing a different message within the select element may be difficult as the existing data (from configdata) for each option is set in core code here. If no data is set for the option, the default value is used.

One option would be to add a message by accessing the $progress->blockconfig within the edit form then performing a query to ensure that the group exists.

Workaround: The workaround is to just set the option to another group, then set back to 'All participants'