From 1417d90b4e297c217143f432f0b0b81a4836a69d Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Mon, 20 May 2024 17:06:29 +1200 Subject: [PATCH] API Set extension hook implementation visibility to protected --- code/Extension/UserFormFieldEditorExtension.php | 12 ++++++------ code/Extension/UserFormFileExtension.php | 2 +- code/Extensions/UsedOnTableExtension.php | 4 ++-- code/Model/EditableFormField.php | 2 +- .../EditableFormField/EditableFieldGroupEnd.php | 2 +- code/Model/EditableFormField/EditableFileField.php | 2 +- code/Model/Recipient/EmailRecipient.php | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/code/Extension/UserFormFieldEditorExtension.php b/code/Extension/UserFormFieldEditorExtension.php index 682d6a9..805aa7f 100644 --- a/code/Extension/UserFormFieldEditorExtension.php +++ b/code/Extension/UserFormFieldEditorExtension.php @@ -54,7 +54,7 @@ class UserFormFieldEditorExtension extends DataExtension * * @return FieldList */ - public function updateCMSFields(FieldList $fields) + protected function updateCMSFields(FieldList $fields) { $fieldEditor = $this->getFieldEditorGrid(); @@ -178,7 +178,7 @@ class UserFormFieldEditorExtension extends DataExtension /** * Ensure that at least one page exists at the start */ - public function onAfterWrite() + protected function onAfterWrite() { $this->createInitialFormStep(); } @@ -186,7 +186,7 @@ class UserFormFieldEditorExtension extends DataExtension /** * Remove any orphaned child records on publish */ - public function onAfterPublish() + protected function onAfterPublish() { // store IDs of fields we've published $seenIDs = []; @@ -220,7 +220,7 @@ class UserFormFieldEditorExtension extends DataExtension /** * Remove all fields from the live stage when unpublishing the page */ - public function onAfterUnpublish() + protected function onAfterUnpublish() { foreach ($this->owner->Fields() as $field) { $field->deleteFromStage(Versioned::LIVE); @@ -236,7 +236,7 @@ class UserFormFieldEditorExtension extends DataExtension * @param string $manyMany * @return DataObject */ - public function onAfterDuplicate($oldPage, $doWrite, $manyMany) + protected function onAfterDuplicate($oldPage, $doWrite, $manyMany) { // List of EditableFieldGroups, where the key of the array is the ID of the old end group $fieldGroups = []; @@ -289,7 +289,7 @@ class UserFormFieldEditorExtension extends DataExtension /** * @see Versioned::doRevertToLive */ - public function onAfterRevertToLive() + protected function onAfterRevertToLive() { foreach ($this->owner->Fields() as $field) { $field->copyVersionToStage(Versioned::LIVE, Versioned::DRAFT); diff --git a/code/Extension/UserFormFileExtension.php b/code/Extension/UserFormFileExtension.php index 82f5a60..18e61fb 100644 --- a/code/Extension/UserFormFileExtension.php +++ b/code/Extension/UserFormFileExtension.php @@ -44,7 +44,7 @@ class UserFormFileExtension extends DataExtension * @param bool $value * @see File::isTrackedFormUpload(), UserDefinedFormController::process() */ - public function updateTrackedFormUpload(&$value): void + protected function updateTrackedFormUpload(&$value): void { $file = $this->owner; if ($file->UserFormUpload != self::USER_FORM_UPLOAD_UNKNOWN) { diff --git a/code/Extensions/UsedOnTableExtension.php b/code/Extensions/UsedOnTableExtension.php index e9c084f..409bd28 100644 --- a/code/Extensions/UsedOnTableExtension.php +++ b/code/Extensions/UsedOnTableExtension.php @@ -23,7 +23,7 @@ class UsedOnTableExtension extends Extension * @param array $ancestorDataObjects * @param DataObject $dataObject|null */ - public function updateUsageDataObject(?DataObject &$dataObject) + protected function updateUsageDataObject(?DataObject &$dataObject) { if (!($dataObject instanceof SubmittedFileField)) { return; @@ -41,7 +41,7 @@ class UsedOnTableExtension extends Extension * @param array $ancestorDataObjects * @param DataObject $dataObject */ - public function updateUsageAncestorDataObjects(array &$ancestorDataObjects, DataObject $dataObject) + protected function updateUsageAncestorDataObjects(array &$ancestorDataObjects, DataObject $dataObject) { // SubmittedFileField was changed to a Submitted Form in updateUsageModifyOrExcludeDataObject() if (!($dataObject instanceof SubmittedForm)) { diff --git a/code/Model/EditableFormField.php b/code/Model/EditableFormField.php index ed1ee19..203d2c9 100755 --- a/code/Model/EditableFormField.php +++ b/code/Model/EditableFormField.php @@ -421,7 +421,7 @@ class EditableFormField extends DataObject ); } - public function onBeforeWrite() + protected function onBeforeWrite() { parent::onBeforeWrite(); diff --git a/code/Model/EditableFormField/EditableFieldGroupEnd.php b/code/Model/EditableFormField/EditableFieldGroupEnd.php index 9a214e0..cff894f 100644 --- a/code/Model/EditableFormField/EditableFieldGroupEnd.php +++ b/code/Model/EditableFormField/EditableFieldGroupEnd.php @@ -77,7 +77,7 @@ class EditableFieldGroupEnd extends EditableFormField return false; } - public function onAfterWrite() + protected function onAfterWrite() { parent::onAfterWrite(); diff --git a/code/Model/EditableFormField/EditableFileField.php b/code/Model/EditableFormField/EditableFileField.php index 536502a..a414500 100755 --- a/code/Model/EditableFormField/EditableFileField.php +++ b/code/Model/EditableFormField/EditableFileField.php @@ -275,7 +275,7 @@ class EditableFileField extends EditableFormField return round(static::get_php_max_file_size() / 1024 / 1024, 1); } - public function onBeforeWrite() + protected function onBeforeWrite() { parent::onBeforeWrite(); diff --git a/code/Model/Recipient/EmailRecipient.php b/code/Model/Recipient/EmailRecipient.php index 0923a07..d7eb4e3 100644 --- a/code/Model/Recipient/EmailRecipient.php +++ b/code/Model/Recipient/EmailRecipient.php @@ -137,7 +137,7 @@ class EmailRecipient extends DataObject DB::query("UPDATE \"UserDefinedForm_EmailRecipient\" SET \"FormClass\" = 'Page' WHERE \"FormClass\" IS NULL"); } - public function onBeforeWrite() + protected function onBeforeWrite() { parent::onBeforeWrite();