From 8d3a5d997e5417531a0b832e71637a5f57a396b0 Mon Sep 17 00:00:00 2001 From: Kevin Percy Date: Fri, 17 Jan 2025 15:54:31 +0800 Subject: [PATCH] MDL-70610 core: Fix typos (alot -> a lot, acces -> access, etc) --- .../tests/user_deleted_observer_test.php | 4 +- competency/classes/api.php | 66 +++++++++---------- competency/tests/event/events_test.php | 8 +-- enrol/paypal/lang/en/enrol_paypal.php | 2 +- lib/behat/classes/behat_core_generator.php | 6 +- lib/upgrade.txt | 2 +- mod/assign/tests/base_test.php | 2 +- .../backup/moodle2/backup_lesson_stepslib.php | 2 +- search/classes/engine.php | 2 +- 9 files changed, 47 insertions(+), 47 deletions(-) diff --git a/admin/tool/dataprivacy/tests/user_deleted_observer_test.php b/admin/tool/dataprivacy/tests/user_deleted_observer_test.php index cb2cb06accc..3c97fb08d35 100644 --- a/admin/tool/dataprivacy/tests/user_deleted_observer_test.php +++ b/admin/tool/dataprivacy/tests/user_deleted_observer_test.php @@ -121,7 +121,7 @@ final class user_deleted_observer_test extends \advanced_testcase { * Ensure that a delete data request is being created upon user deletion * if a finished delete data request (excluding complete) for that user already exists. */ - public function test_create_delete_data_request_canceled_delete_data_request_preexists(): void { + public function test_create_delete_data_request_cancelled_delete_data_request_preexists(): void { $this->resetAfterTest(); $this->setAdminUser(); @@ -135,7 +135,7 @@ final class user_deleted_observer_test extends \advanced_testcase { $requestid = $datarequest->get('id'); api::update_request_status($requestid, api::DATAREQUEST_STATUS_CANCELLED); - // Validate that delete data request has been created and the status has been updated to 'Canceled'. + // Validate that delete data request has been created and the status has been updated to 'Cancelled'. $this->assertEquals(1, api::get_data_requests_count($user->id, [], [api::DATAREQUEST_TYPE_DELETE])); $this->assertFalse(api::has_ongoing_request($user->id, api::DATAREQUEST_TYPE_DELETE)); diff --git a/competency/classes/api.php b/competency/classes/api.php index 5212f6580c6..a8a3759a3e6 100644 --- a/competency/classes/api.php +++ b/competency/classes/api.php @@ -122,7 +122,7 @@ class api { } /** - * Validate if current user have acces to the course_module if hidden. + * Validate if current user has access to the course_module if hidden. * * @param mixed $cmmixed The cm_info class, course module record or its ID. * @param bool $throwexception Throw an exception or not. @@ -152,7 +152,7 @@ class api { } /** - * Validate if current user have acces to the course if hidden. + * Validate if current user has access to the course if hidden. * * @param mixed $courseorid The course or it ID. * @param bool $throwexception Throw an exception or not. @@ -454,7 +454,7 @@ class api { } /** - * Read a the details for a single competency and return a record. + * Read the details for a single competency and return a record. * * Requires moodle/competency:competencyview capability at the system context. * @@ -484,7 +484,7 @@ class api { } /** - * Perform a text search based and return all results and their parents. + * Perform a search based on a text and return all results and their parents. * * Requires moodle/competency:competencyview capability at the framework context. * @@ -615,7 +615,7 @@ class api { $framework->set('id', 0); $framework = $framework->create(); - // Array that match the old competencies ids with the new one to use when copying related competencies. + // Array that matches the old competencies ids with the new one to use when copying related competencies. $frameworkcompetency = competency::get_framework_tree($id); $matchids = self::duplicate_competency_tree($framework->get('id'), $frameworkcompetency, 0, 0); @@ -705,7 +705,7 @@ class api { // Commit the transaction. $transaction->allow_commit(); - // If all operations are successfull then trigger the delete event. + // If all operations are successful then trigger the delete event. $event->trigger(); // Trigger deleted event competencies. @@ -744,7 +744,7 @@ class api { } /** - * Read a the details for a single competency framework and return a record. + * Read the details for a single competency framework and return a record. * * Requires moodle/competency:competencyview capability at the system context. * @@ -763,7 +763,7 @@ class api { } /** - * Logg the competency framework viewed event. + * Log the competency framework viewed event. * * @param competency_framework|int $frameworkorid The competency_framework object or competency framework id * @return bool @@ -784,7 +784,7 @@ class api { } /** - * Logg the competency viewed event. + * Log the competency viewed event. * * @param competency|int $competencyorid The competency object or competency id * @return bool @@ -1025,7 +1025,7 @@ class api { $cm = get_coursemodule_from_id('', $cmorid, 0, true, MUST_EXIST); } - // Check the user have access to the course module. + // Check the user has access to the course module. self::validate_course_module($cm); $context = context_module::instance($cm->id); @@ -1084,7 +1084,7 @@ class api { */ public static function count_proficient_competencies_in_course_for_user($courseid, $userid) { static::require_enabled(); - // Check the user have access to the course. + // Check the user has access to the course. self::validate_course($courseid); // First we do a permissions check. @@ -1107,7 +1107,7 @@ class api { */ public static function count_competencies_in_course($courseid) { static::require_enabled(); - // Check the user have access to the course. + // Check the user has access to the course. self::validate_course($courseid); // First we do a permissions check. @@ -1138,7 +1138,7 @@ class api { $course = get_course($courseorid); } - // Check the user have access to the course. + // Check the user has access to the course. self::validate_course($course); $context = context_course::instance($course->id); @@ -1217,7 +1217,7 @@ class api { $cm = get_coursemodule_from_id('', $cmorid, 0, true, MUST_EXIST); } - // Check the user have access to the course module. + // Check the user has access to the course module. self::validate_course_module($cm); $context = context_module::instance($cm->id); @@ -1245,7 +1245,7 @@ class api { $cm = get_coursemodule_from_id('', $cmorid, 0, true, MUST_EXIST); } - // Check the user have access to the course module. + // Check the user has access to the course module. self::validate_course_module($cm); $context = context_module::instance($cm->id); @@ -1457,7 +1457,7 @@ class api { $cm = get_coursemodule_from_id('', $cmorid, 0, true, MUST_EXIST); } - // Check the user have access to the course module. + // Check the user has access to the course module. self::validate_course_module($cm); // First we do a permissions check. @@ -1499,7 +1499,7 @@ class api { if (!is_object($cmorid)) { $cm = get_coursemodule_from_id('', $cmorid, 0, true, MUST_EXIST); } - // Check the user have access to the course module. + // Check the user has access to the course module. self::validate_course_module($cm); // First we do a permissions check. @@ -1535,7 +1535,7 @@ class api { if (!is_object($cmorid)) { $cm = get_coursemodule_from_id('', $cmorid, 0, true, MUST_EXIST); } - // Check the user have access to the course module. + // Check the user has access to the course module. self::validate_course_module($cm); // First we do a permissions check. @@ -1616,7 +1616,7 @@ class api { */ public static function add_competency_to_course($courseid, $competencyid) { static::require_enabled(); - // Check the user have access to the course. + // Check the user has access to the course. self::validate_course($courseid); // First we do a permissions check. @@ -1630,7 +1630,7 @@ class api { $competency = new competency($competencyid); - // Can not add a competency that belong to a hidden framework. + // Can not add a competency that belongs to a hidden framework. if ($competency->get_framework()->get('visible') == false) { throw new coding_exception('A competency belonging to hidden framework can not be linked to course'); } @@ -1655,7 +1655,7 @@ class api { */ public static function remove_competency_from_course($courseid, $competencyid) { static::require_enabled(); - // Check the user have access to the course. + // Check the user has access to the course. self::validate_course($courseid); // First we do a permissions check. @@ -1692,7 +1692,7 @@ class api { */ public static function reorder_course_competency($courseid, $competencyidfrom, $competencyidto) { static::require_enabled(); - // Check the user have access to the course. + // Check the user has access to the course. self::validate_course($courseid); // First we do a permissions check. @@ -1954,7 +1954,7 @@ class api { } /** - * Read a the details for a single learning plan template and return a record. + * Read the details for a single learning plan template and return a record. * * Requires moodle/competency:templateview capability at the system context. * @@ -2197,7 +2197,7 @@ class api { $competency = new competency($competencyid); - // Can not add a competency that belong to a hidden framework. + // Can not add a competency that belongs to a hidden framework. if ($competency->get_framework()->get('visible') == false) { throw new coding_exception('A competency belonging to hidden framework can not be added'); } @@ -2686,9 +2686,9 @@ class api { throw new required_capability_exception($plan->get_context(), 'moodle/competency:planmanage', 'nopermissions', ''); } - // Only plan with status DRAFT or ACTIVE can be unliked.. + // Only plan with status DRAFT or ACTIVE can be unlinked.. if ($plan->get('status') == plan::STATUS_COMPLETE) { - throw new coding_exception('Only draft or active plan can be unliked from a template'); + throw new coding_exception('Only draft or active plan can be unlinked from a template'); } // Early exit, it's already done... @@ -3363,7 +3363,7 @@ class api { } if (!$plan->can_be_edited()) { - throw new coding_exception('A competency can not be added to a learning plan completed'); + throw new coding_exception('A competency can not be added to a completed learning plan'); } $competency = new competency($competencyid); @@ -3406,7 +3406,7 @@ class api { } if (!$plan->can_be_edited()) { - throw new coding_exception('A competency can not be removed from a learning plan completed'); + throw new coding_exception('A competency can not be removed from a completed learning plan'); } $link = plan_competency::get_record(array('planid' => $planid, 'competencyid' => $competencyid)); @@ -3440,7 +3440,7 @@ class api { } if (!$plan->can_be_edited()) { - throw new coding_exception('A competency can not be reordered in a learning plan completed'); + throw new coding_exception('A competency can not be reordered in a completed learning plan'); } $down = true; @@ -3492,7 +3492,7 @@ class api { if (!$uc || !$uc->can_read()) { throw new required_capability_exception($context, 'moodle/competency:usercompetencyview', 'nopermissions', ''); } else if ($uc->get('status') != user_competency::STATUS_WAITING_FOR_REVIEW) { - throw new coding_exception('The competency can not be cancel review request at this stage.'); + throw new coding_exception('The competency review request can not be cancelled at this stage.'); } else if (!$uc->can_request_review()) { throw new required_capability_exception($context, 'moodle/competency:usercompetencyrequestreview', 'nopermissions', ''); } @@ -3637,7 +3637,7 @@ class api { } $plan = new plan($planid); if ($plan->get('status') == plan::STATUS_COMPLETE) { - throw new coding_exception('To log the user competency in completed plan use user_competency_plan_viewed method.'); + throw new coding_exception('To log the user competency in a completed plan use the user_competency_plan_viewed method.'); } \core\event\competency_user_competency_viewed_in_plan::create_from_user_competency_viewed_in_plan($uc, $planid)->trigger(); @@ -3770,7 +3770,7 @@ class api { static::require_enabled(); $competency = new competency($competencyid); - // This only check if we have the permission in either competency because both competencies + // This only checks if we have the permission in either competency because both competencies // should belong to the same framework. require_capability('moodle/competency:competencymanage', $competency->get_context()); @@ -4324,7 +4324,7 @@ class api { // if rating outside a course // - set the default grade and proficiency ONLY if there is no current grade // else we are in a course - // - set the defautl grade and proficiency in the course ONLY if there is no current grade in the course + // - set the default grade and proficiency in the course ONLY if there is no current grade in the course // - then check the course settings to see if we should push the rating outside the course // - if we should push it // --- push it only if the user_competency (outside the course) has no grade diff --git a/competency/tests/event/events_test.php b/competency/tests/event/events_test.php index ca0faef7769..93ea259ea48 100644 --- a/competency/tests/event/events_test.php +++ b/competency/tests/event/events_test.php @@ -706,11 +706,11 @@ final class events_test extends \advanced_testcase { try { api::user_competency_viewed_in_plan($uc, $plan->get('id')); - $this->fail('To log the user competency in completed plan ' - . 'use user_competency_plan_viewed method.'); + $this->fail('To log the user competency in a completed plan ' + . 'use the user_competency_plan_viewed method.'); } catch (\coding_exception $e) { - $this->assertMatchesRegularExpression('/To log the user competency in completed plan ' - . 'use user_competency_plan_viewed method./', $e->getMessage()); + $this->assertMatchesRegularExpression('/To log the user competency in a completed plan ' + . 'use the user_competency_plan_viewed method./', $e->getMessage()); } api::reopen_plan($plan); diff --git a/enrol/paypal/lang/en/enrol_paypal.php b/enrol/paypal/lang/en/enrol_paypal.php index 6a92037af0b..7130e1776d9 100644 --- a/enrol/paypal/lang/en/enrol_paypal.php +++ b/enrol/paypal/lang/en/enrol_paypal.php @@ -63,7 +63,7 @@ $string['privacy:metadata:enrol_paypal:enrol_paypal:instanceid'] = 'The ID of th $string['privacy:metadata:enrol_paypal:enrol_paypal:item_name'] = 'The full name of the course that its enrolment has been sold.'; $string['privacy:metadata:enrol_paypal:enrol_paypal:memo'] = 'A note that was entered by the buyer in PayPal website payments note field.'; $string['privacy:metadata:enrol_paypal:enrol_paypal:option_selection1_x'] = 'Full name of the buyer.'; -$string['privacy:metadata:enrol_paypal:enrol_paypal:parent_txn_id'] = 'In the case of a refund, reversal, or canceled reversal, this would be the transaction ID of the original transaction.'; +$string['privacy:metadata:enrol_paypal:enrol_paypal:parent_txn_id'] = 'In the case of a refund, reversal, or cancelled reversal, this would be the transaction ID of the original transaction.'; $string['privacy:metadata:enrol_paypal:enrol_paypal:payment_status'] = 'The status of the payment.'; $string['privacy:metadata:enrol_paypal:enrol_paypal:payment_type'] = 'Holds whether the payment was funded with an eCheck (echeck), or was funded with PayPal balance, credit card, or instant transfer (instant).'; $string['privacy:metadata:enrol_paypal:enrol_paypal:pending_reason'] = 'The reason why payment status is pending (if that is).'; diff --git a/lib/behat/classes/behat_core_generator.php b/lib/behat/classes/behat_core_generator.php index c84d9dcee47..5b24aecb35b 100644 --- a/lib/behat/classes/behat_core_generator.php +++ b/lib/behat/classes/behat_core_generator.php @@ -1196,15 +1196,15 @@ class behat_core_generator extends behat_generator_base { global $DB; if (!isset($data['userid'])) { - throw new Exception('\'last acces times\' requires the field \'user\' to be specified'); + throw new Exception('\'last access times\' requires the field \'user\' to be specified'); } if (!isset($data['courseid'])) { - throw new Exception('\'last acces times\' requires the field \'course\' to be specified'); + throw new Exception('\'last access times\' requires the field \'course\' to be specified'); } if (!isset($data['lastaccess'])) { - throw new Exception('\'last acces times\' requires the field \'lastaccess\' to be specified'); + throw new Exception('\'last access times\' requires the field \'lastaccess\' to be specified'); } $userdata = []; diff --git a/lib/upgrade.txt b/lib/upgrade.txt index 01ff074df91..90c3d2d0857 100644 --- a/lib/upgrade.txt +++ b/lib/upgrade.txt @@ -1598,7 +1598,7 @@ the groupid field. moodle/site:configview capability added. * Admin setting "Show My courses expanded on Dashboard" has been removed. * Some backwards and forwards compatibility has been added for different bootstrap versions. - This is to allow the same markup to work in "clean" and "boost" themes alot of the time. It is also to allow user text + This is to allow the same markup to work in "clean" and "boost" themes a lot of the time. It is also to allow user text with bootstrap classes to keep working in the new theme. See MDL-56004 for the list of supported classes. * MForms element 'submitlink' has been deprecated. * Searchable selector form element is now a wrapper for autocomplete. A "No selection" option is automatically diff --git a/mod/assign/tests/base_test.php b/mod/assign/tests/base_test.php index db669faae91..dfab907f374 100644 --- a/mod/assign/tests/base_test.php +++ b/mod/assign/tests/base_test.php @@ -134,7 +134,7 @@ final class base_test extends \advanced_testcase { } /* - * For tests that make sense to use alot of data, create extra students/teachers. + * For tests that make sense to use a lot of data, create extra students/teachers. */ protected function create_extra_users() { global $DB; diff --git a/mod/lesson/backup/moodle2/backup_lesson_stepslib.php b/mod/lesson/backup/moodle2/backup_lesson_stepslib.php index 1991ac3dd2b..0edd0bd8560 100644 --- a/mod/lesson/backup/moodle2/backup_lesson_stepslib.php +++ b/mod/lesson/backup/moodle2/backup_lesson_stepslib.php @@ -66,7 +66,7 @@ class backup_lesson_activity_structure_step extends backup_activity_structure_st // The lesson table // This table contains all of the goodness for the lesson module, quite - // alot goes into it but nothing relational other than course when will + // a lot goes into it but nothing relational other than course when will // need to be corrected upon restore. $lesson = new backup_nested_element('lesson', array('id'), array( 'course', 'name', 'intro', 'introformat', 'practice', 'modattempts', diff --git a/search/classes/engine.php b/search/classes/engine.php index bef1dd3656f..ec9d69c232e 100644 --- a/search/classes/engine.php +++ b/search/classes/engine.php @@ -542,7 +542,7 @@ abstract class engine { * Executes the query on the engine. * * Implementations of this function should check user context array to limit the results to contexts where the - * user have access. They should also limit the owneruserid field to manger::NO_OWNER_ID or the current user's id. + * user has access. They should also limit the owneruserid field to manger::NO_OWNER_ID or the current user's id. * Engines must use area->check_access() to confirm user access. * * Engines should reasonably attempt to fill up to limit with valid results if they are available.