Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
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_calculated_grade_items ($courseid=null)
 Marks all courses that require calculated grade items be updated. More...
 
 upgrade_calendar_action_events_fix (stdClass $info, bool $output=true, int $endtime=0)
 Detects the calendar action events needing to be fixed. More...
 
 upgrade_calendar_events_fix_remaining (array $info, bool $output=true, int $maxseconds=0)
 Detects the calendar events needing to be fixed. More...
 
 upgrade_calendar_events_get_teacherid (int $courseid)
 Get a valid editing teacher for a given courseid. More...
 
 upgrade_calendar_events_mtrace (string $string, bool $output)
 Wrapper over mtrace() to allow a few more things to be specified. More...
 
 upgrade_calendar_events_status (bool $output=true)
 Detects the calendar events needing to be fixed. More...
 
 upgrade_calendar_override_events_fix (stdClass $info, bool $output=true, int $endtime=0)
 Detects the calendar override events needing to be fixed. More...
 
 upgrade_calendar_site_status (bool $output=true)
 Detects if the site may need to get the calendar events fixed or no. More...
 
 upgrade_calendar_standard_events_fix (stdClass $info, bool $output=true, int $endtime=0)
 Detects the calendar standard events needing to be fixed. More...
 
 upgrade_calendar_subscription_events_fix (stdClass $info, bool $output=true, int $endtime=0)
 Detects the calendar subscription events needing to be fixed. 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_core_licenses ()
 Upgrade core licenses shipped with Moodle.
 
 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_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!)