This just deletes all the upgrade steps previous to 3.9.0. Some
small adjustments, like tweaking globals can also be applied
when needed.
Also includes an upgrade step to prevent upgrading from any
version < 2020061500 (v3.9.0) as anti-cheating measure.
The next commits will proceed to deprecate / remove functions
that were exclusively (usually belonging to upgradelib) being
used by those, now removed, upgrade steps. This is the list
of code to remove and document in upgrade.txt files:
- upgrade_analytics_fix_contextids_defaults()
- upgrade_convert_hub_config_site_param_names()
- upgrade_rename_prediction_actions_useful_incorrectly_flagged()
- \mod_forum\task\refresh_forum_post_counts adhoc task.
And these is the code that has NOT been removed
because it may be needed later (no matter there aren't uses now):
- \core_search\manager::clean_up_non_existing_area(), used by
- \core\task\clean_up_deleted_search_area_task adhoc task
Applied the following changes to various testcase classes:
- Namespaced with component[\level2-API]
- Moved to level2-API subdirectory when required.
- Fixed incorrect use statements with leading backslash.
- Remove file phpdoc block
- Remove MOODLE_INTERNAL if not needed.
- Changed code to point to global scope when needed.
- Fix some relative paths and comments here and there.
- All them passing individually.
- Complete runs passing too.
Special mention to:
- Some fixtures, initially defined in the test files have been
moved to new files in fixtures subdirectory, leaving the unit
test files clearer:
- moodle2_course_format_test.php
- Rename wrong named test:
- baseoptiogroup_test = baseoptigroup_test
By adding the step:
Given remote langimport tests are enabled
We make the execution of scenarios requiring to install /
upgrade lang packs optional, based in the existence of the constant:
TOOL_LANGIMPORT_REMOTE_TESTS
That way, when we are skipping language upgrades with the CFG var:
$CFG->skiplangupgrade = true
We can decide not not execute those tests.
With other words, putting something like this in the config.php
file we will be controlling when to execute or no the behat tests:
// Disable lang updates on upgrade.
$CFG->skiplangupgrade = true;
if (empty($CFG->skiplangupgrade)) {
// Define it only if we aren't skipping lang upgrades.
define('TOOL_LANGIMPORT_REMOTE_TESTS', true);
}
AdoDB SQL*Server drivers use to modify some error and
logging preferences. As far as the connection is shared
with the main one, that implies that those settings
remain for the whole remaining execution.
We don't want his in tests, because can affect to other
tests at distance.
We are fixing this here, only for tests, because it
doesn't affect normal requests and because, once we
remove AdoDB this won't be needed anymore.
Before applying a preset, the settings are displayed and, in some cases,
the Current/New value columns were empty.
This patch fixes it and guarantees this information is updated properly
every time the set_value() method is called.
Three modes are initially introduced here, for use by dependent code:
1. Automatic - where accounts will be automatically created for users
2. Prompt new or existing - where the user can choose to use an existing
account or have a new account created for them.
3. Prompt existing only - where users must link an existing account.
This change also adds linked logins, for use with provisioning.
All restore_date_test, api_test, rule_test, plugin_test,
manager_test, helper_test testcase classes:
- Namespaced with component[\level2-API]
- Moved to level2-API subdirectory when required.
- Fixed incorrect use statements with leading backslash.
- Remove file phpdoc block
- Remove MOODLE_INTERNAL if not needed.
- Changed code to point to global scope when needed.
- Fix some relative paths and comments here and there.
- All them passing individually.
- Complete runs passing too.
Special mention to:
- All restore_date_test cases have been put under xxx\backup
level 2 (valid API) namespace.
This commit removes code that only was being executed by php < 73
and it's 100% safe to do so because Moodle 3.11 and up require
php 73, hence it was not executed ever.
Removed code includes:
- ldap_control_paged_result and ldap_control_paged_result_response
(that were deprecated in php 73 and have been removed in php 80).
- conditional code in the session manager, where some hacks were
needed for php < 73. Note that this removes the private function
append_samesite_cookie_attribute() completely because it was
doinf nothing (first line was returning for php < 73).
- Also removed the old session.hash_function ini setting because
it was removed in php 71.
Kept code includes:
- The environmental check_igbinary322_version test has not been
removed because it doesn't hurt (always returns "ok" for php 73
sites) and doing it would involve to backport the environment.xml
file to 39 and 310. Instead, a note has been added to MDL-71747
in order to get rid of that check for 4.1 and up.
All events_test, external_test and search_test classes:
- Namespaced with component[\level2-API]
- Moved to level2-API subdirectory when required.
- Fixed incorrect use statements with leading backslash.
- Changed code to point to global scope when needed.
- Fix some relative paths and comments here and there.
- All them passing individually.
- Complete runs passing too.
Special mention to lib/external/tests/external_test.php:
- external is not a valid component
- hence, its only valid namespace is "core"
- also, it's testing lib/external/externallib.php
- hence, the file (and class) have been renamed to external_externallib_test.php
(to avoid conflicts with other external_test that may exist in core)
The following lang strings have been undepecated, as they are still
in use:
* errorcoursewronglypublished, core_hub
* eventrolecapabilitiesupdated, core_role
As far as now all them have correct privacy level2 namespace:
- Move them to "privacy" subdir.
- Rename the files to "provider_test.php", this includes old
privacy_test.php and privacy_provider_test.php files
- Rename the testcase to provider_test too (to match file name)
Also, change some relative paths and comments to point to new
locations.
All privacy_test and privacy_provider_test classes:
- Namespaced with component\privacy.
- Fixed incorrect use statements with leading backslash.
- Changed code to point to global scope when needed.
- Renamed a few files to make all be privacy_test or privacy_provider_test.php
- All them passing individually.
- Complete runs passing too.
On account creation by Oauth2 all configured mapped user
fields are now saved in the user profile on user creation.
Co-Authored-By: SKOLL Learning Technologies