This commit integrate and clean the social activities block to use the
standard course format outputs and the course editor modules. The code
is similar to the one used in the site_main_menu block and cleanup most
of the ancient code.
The commit adds all the necessary methods to allow social format to use
the course editor. The code is similar to the one used in the frontpage
format. The commit does not include the migration of the
social_activities blocks.
Some formats like the social need the blocks and drawers to access the
course editor. However, the include_course_ajax was called after the
main page structure is created and produces some errors, especially in
behat. Now include_course_ajax is called before the page header.
The course_ajax_enabled was using a course_format_ajax_support which
does not initialize the course format with the correct parameters.
Having a global function to get something the format base format can
provide is unnecessary and redudant, for this reason the function is now
deprecated.
The current code may have a bug. If users set the audio bit rate to
a non-supported value, such as 1000,
Firefox will display an error in the console,
while Chrome will create the recorded audio file successfully,
but it will have no sound. I tested this on Ubuntu 24.04.
The minimum bit rate threshold varies depending on the audio format.
During my tests with Firefox version 131.0.3, which uses
the audio/Ogg format, I found that the minimum supported value
is 24000. In Chrome 129.0.6668.70, which uses the audio/MP4 format,
the minimum supported value is 2400.
Due to these differences, I decided to change the input from
a text field to a select field, offering options that support both
Ogg and MP4 audio formats.
The database conversion for the old value has been provided in
the lib/db/upgrade.php. The script will find the closest match to
the current data and update it accordingly.
This is mainly for the benefit of multilang users.
As well as changing the database schema, it is also necessary to change
where this is inforced in PHP code (forms, web services). This was missed
when shortname was changed from 100 to 255 chars some time ago, but I have
fixed that here.
Note, I have not changed the legacy mnet code, since as far as I am aware
that is deprecated.