Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Functions
upgradelib.php File Reference

Upgrade helper functions. More...

Functions

 make_competence_scale ()
 Create another default scale. More...
 
object make_default_scale ()
 This function creates a default separated/connected scale so there's something in the database. More...
 
 upgrade_analytics_fix_contextids_defaults ()
 Fix the incorrect default values inserted into analytics contextids field.
 
 upgrade_block_positions ()
 Delete orphaned records in block_positions.
 
 upgrade_calculated_grade_items ($courseid=null)
 Marks all courses that require calculated grade items be updated. More...
 
 upgrade_convert_hub_config_site_param_names (stdClass $hubconfig, string $huburl)
 Convert the site settings for the 'hub' component in the config_plugins table. More...
 
 upgrade_course_letter_boundary ($courseid=null)
 Marks all courses that require rounded grade items be updated. More...
 
 upgrade_delete_orphaned_file_records ()
 Deletes file records which have their repository deleted.
 
 upgrade_extra_credit_weightoverride ($onlycourseid=0)
 Marks all courses with changes in extra credit weight calculation. More...
 
 upgrade_fix_block_instance_configuration ()
 Fix configdata in block instances that are using the old object class that has been removed (deprecated).
 
 upgrade_fix_serialized_objects ($serializeddata)
 Provides a way to check and update a serialized string that uses the deprecated object class. More...
 
 upgrade_group_members_only ($groupingid, $availability)
 Using data for a single course-module that has groupmembersonly enabled, returns the new availability value that incorporates the correct groupmembersonly option. More...
 
 upgrade_letter_boundary_needs_freeze ($context)
 Checks the letter boundary of the provided context to see if it needs freezing. More...
 
 upgrade_mysql_get_supported_tables ()
 Returns all non-view and non-temp tables with sane names. More...
 
 upgrade_rename_prediction_actions_useful_incorrectly_flagged ()
 Updates the existing prediction actions in the database according to the new suggested actions. More...
 
 upgrade_standardise_score ($rawgrade, $sourcemin, $sourcemax, $targetmin, $targetmax)
 Given a float value situated between a source minimum and a source maximum, converts it to the corresponding value situated between a target minimum and a target maximum. More...
 

Detailed Description

Upgrade helper functions.

This file is used for special upgrade functions - for example groups and gradebook. These functions must use SQL and database related functions only- no other Moodle API, because it might depend on db structures that are not yet present during upgrade. (Do not use functions from accesslib.php, grades classes or group functions at all!)