Skip to content

Commit 4418856

Browse files
authored
DOC Correct typos with codespell (#1431)
Source code (5 files): - Additonal → Additional (GridFieldAddClassesButton.php) - dependant → dependent (EditableFormField.php) - anythign → anything (UserDefinedFormAdmin.php) - calss → calls (UserDefinedFormAdmin.php) - submisison → submission (UserDefinedFormAdmin.php) - excede → exceed (UserDefinedFormController.php) - langauge → language (UserDefinedFormController.php) - reciever → receiver (UserDefinedFormController.php) - finshed → finished (UserDefinedFormController.php) - beacause → because (UserDefinedFormController.php) Client source (1 file): - visibilty → visibility (UserForms.js) - sence → sense (UserForms.js) - effectivly → effectively (UserForms.js) Tests (3 files): - buton → button (userforms.feature) - non-existant → non-existent (UserDefinedFormAdminTest.php) - orignal → original (UserDefinedFormTest.php) All changes are to comments, documentation, test files, and test variables. No functional code changes.
1 parent 4b0c6ff commit 4418856

8 files changed

Lines changed: 17 additions & 17 deletions

File tree

client/src/bundles/UserForms.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ jQuery(document).ready(($) => {
217217
});
218218
}
219219

220-
// Ensure that page visibilty updates the step navigation
220+
// Ensure that page visibility updates the step navigation
221221
this
222222
.$elButton
223223
.on('userform.field.hide userform.field.show', () => {
@@ -514,7 +514,7 @@ jQuery(document).ready(($) => {
514514
}, 0);
515515
},
516516
// Callback for handling the actual submit when the form is valid.
517-
// Submission in the jQuery.validate sence is handled at step level.
517+
// Submission in the jQuery.validate sense is handled at step level.
518518
// So when the final step is submitted we have to also check all previous steps are valid.
519519
submitHandler: (form) => {
520520
let isValid = true;
@@ -631,7 +631,7 @@ jQuery(document).ready(($) => {
631631
}
632632

633633
// Validate the form.
634-
// This well effectivly validate the current step and not the entire form.
634+
// This will effectively validate the current step and not the entire form.
635635
// This is because hidden fields are excluded from validation, and all fields
636636
// on all other steps, are currently hidden.
637637
isValid = this.$el.valid();

code/Control/UserDefinedFormAdmin.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ private static function getRestrictedAccessField(string $folder, string $title)
7777

7878
public function index(HTTPRequest $request): HTTPResponse
7979
{
80-
// Don't serve anythign under the main URL.
80+
// Don't serve anything under the main URL.
8181
return $this->httpError(404);
8282
}
8383

@@ -146,7 +146,7 @@ public function confirmfolderformschema(HTTPRequest $request)
146146
}
147147

148148
/**
149-
* Return the ConfirmFolderForm. This is only exposed so the treeview has somewhere to direct it's AJAX calss.
149+
* Return the ConfirmFolderForm. This is only exposed so the treeview has somewhere to direct it's AJAX calls.
150150
* @return Form
151151
*/
152152
public function ConfirmFolderForm(): Form
@@ -287,7 +287,7 @@ public function getfoldergrouppermissions()
287287
}
288288

289289
/**
290-
* Set the permission for the default submisison folder.
290+
* Set the permission for the default submission folder.
291291
* @throws ValidationException
292292
*/
293293
private static function updateFormSubmissionFolderPermissions()

code/Control/UserDefinedFormController.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class UserDefinedFormController extends PageController
5858
private static string $file_upload_stage = Versioned::DRAFT;
5959

6060
/**
61-
* Size that an uploaded file must not excede for it to be attached to an email
61+
* Size that an uploaded file must not exceed for it to be attached to an email
6262
* Follows PHP "shorthand bytes" definition rules.
6363
* @see UserDefinedFormController::parseByteSizeString()
6464
*
@@ -100,7 +100,7 @@ protected function init()
100100
}
101101

102102
/**
103-
* Add the necessary jQuery validate i18n translation files, either by locale or by langauge,
103+
* Add the necessary jQuery validate i18n translation files, either by locale or by language,
104104
* e.g. 'en_NZ' or 'en'. This adds "methods_abc.min.js" as well as "messages_abc.min.js" from the
105105
* jQuery validate thirdparty library from dist/js.
106106
*/
@@ -453,7 +453,7 @@ public function process($data, $form)
453453
$email->setFrom($this->validEmailsToArray($recipient->EmailFrom));
454454
}
455455

456-
// check to see if they are a dynamic reciever eg based on a dropdown field a user selected
456+
// check to see if they are a dynamic receiver eg based on a dropdown field a user selected
457457
$emailTo = $recipient->SendEmailToField();
458458

459459
try {
@@ -542,7 +542,7 @@ public function process($data, $form)
542542
$session->set('FormProcessed', $data['SecurityID']);
543543
} else {
544544
// if the form has had tokens disabled we still need to set FormProcessed
545-
// to allow us to get through the finshed method
545+
// to allow us to get through the finished method
546546
if (!$this->Form()->getSecurityToken()->isEnabled()) {
547547
$randNum = rand(1, 1000);
548548
$randHash = md5($randNum ?? '');
@@ -660,7 +660,7 @@ function (){
660660
EOS;
661661
if ($isFormStep) {
662662
// Hide the step jump button if the FormStep has is initially hidden.
663-
// This is particularly important beacause the next/prev page buttons logic is controlled by
663+
// This is particularly important because the next/prev page buttons logic is controlled by
664664
// the visibility of the FormStep buttons
665665
// The HTML for the FormStep buttons is defined in the UserFormProgress template
666666
$id = str_replace('#', '', $target ?? '');

code/Form/GridFieldAddClassesButton.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class GridFieldAddClassesButton implements GridField_HTMLProvider, GridField_Act
3030
protected $buttonName;
3131

3232
/**
33-
* Additonal CSS classes for the button
33+
* Additional CSS classes for the button
3434
*
3535
* @var string
3636
*/

code/Model/EditableFormField.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1020,7 +1020,7 @@ public function isDisplayed(array $data)
10201020
foreach ($displayRules as $rule) {
10211021
$controllingField = $rule->ConditionField();
10221022

1023-
// recursively check - if any of the dependant fields are hidden, assume the rule can not be satisfied
1023+
// recursively check - if any of the dependent fields are hidden, assume the rule can not be satisfied
10241024
$ruleSatisfied = $this->checkIsDisplayedRecursionProtection()
10251025
&& $controllingField->isDisplayed($data)
10261026
&& $rule->validateAgainstFormData($data);

tests/behat/features/userforms.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Feature: Userforms
108108
And I should not see "My textfield 2"
109109
And I should not see "My textfield 3"
110110

111-
# Pressing '2' buton should do nothing at this stage
111+
# Pressing '2' button should do nothing at this stage
112112
When I press the "2" button
113113
Then I should see "First Page"
114114

tests/php/Control/UserDefinedFormAdminTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ public function testConfirmfolderInexistingFolder()
192192
$fieldID = $this->idFromFixture(EditableFileField::class, 'file-field-1');
193193

194194
$response = $this->post($url, ['ID' => $fieldID, 'FolderOptions' => 'existing', 'FolderID' => -1]);
195-
$this->assertEquals(400, $response->getStatusCode(), 'Confirm a non-existant folder fails with 400');
195+
$this->assertEquals(400, $response->getStatusCode(), 'Confirm a non-existent folder fails with 400');
196196
}
197197

198198
public function testConfirmfolderRootFolder()

tests/php/Model/UserDefinedFormTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ public function testRollbackToVersion()
6868

6969
$form->rollbackRecursive($origVersion);
7070

71-
$orignal = Versioned::get_one_by_stage(UserDefinedForm::class, 'Stage', "\"UserDefinedForm\".\"ID\" = $form->ID");
72-
$this->assertEquals($orignal->SubmitButtonText, 'Button Text');
71+
$original = Versioned::get_one_by_stage(UserDefinedForm::class, 'Stage', "\"UserDefinedForm\".\"ID\" = $form->ID");
72+
$this->assertEquals($original->SubmitButtonText, 'Button Text');
7373
}
7474

7575
public function testGetCMSFields()

0 commit comments

Comments
 (0)