From 317b6548d75871052d8389a0db16b9c6bf4e00b1 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli Date: Thu, 17 Oct 2024 13:14:53 +1300 Subject: [PATCH] ENH Update code to reflect changes in CMSMain --- code/Model/EditableCustomRule.php | 2 +- code/Model/EditableFormField.php | 4 ++-- code/Model/Recipient/EmailRecipient.php | 4 ++-- code/Model/Recipient/EmailRecipientCondition.php | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/code/Model/EditableCustomRule.php b/code/Model/EditableCustomRule.php index 08fa1b4..f488023 100644 --- a/code/Model/EditableCustomRule.php +++ b/code/Model/EditableCustomRule.php @@ -119,7 +119,7 @@ class EditableCustomRule extends DataObject } // Hack in currently edited page if context is missing if (Controller::has_curr() && Controller::curr() instanceof CMSMain) { - return Controller::curr()->currentPage(); + return Controller::curr()->currentRecord(); } // No page being edited diff --git a/code/Model/EditableFormField.php b/code/Model/EditableFormField.php index 231cd0f..986787e 100755 --- a/code/Model/EditableFormField.php +++ b/code/Model/EditableFormField.php @@ -509,7 +509,7 @@ class EditableFormField extends DataObject // This is to restore User Forms 2.x backwards compatibility. $controller = Controller::curr(); if ($controller && $controller instanceof CMSPageEditController) { - $parent = $controller->getRecord($controller->currentPageID()); + $parent = $controller->getRecord($controller->currentRecordID()); // Only allow this behaviour on pages using UserFormFieldEditorExtension, such // as UserDefinedForm page type. if ($parent && $parent->hasExtension(UserFormFieldEditorExtension::class)) { @@ -572,7 +572,7 @@ class EditableFormField extends DataObject } // Hack in currently edited page if context is missing if (Controller::has_curr() && Controller::curr() instanceof CMSMain) { - return Controller::curr()->currentPage(); + return Controller::curr()->currentRecord(); } // No page being edited diff --git a/code/Model/Recipient/EmailRecipient.php b/code/Model/Recipient/EmailRecipient.php index aa53bbf..7bcfef0 100644 --- a/code/Model/Recipient/EmailRecipient.php +++ b/code/Model/Recipient/EmailRecipient.php @@ -228,7 +228,7 @@ class EmailRecipient extends DataObject // LeftAndMain::sessionNamespace is protected. $sessionNamespace = $this->config()->get('session_namespace') ?: CMSMain::class; - $formID = Controller::curr()->getRequest()->getSession()->get($sessionNamespace . '.currentPage'); + $formID = Controller::curr()->getRequest()->getSession()->get($sessionNamespace . '.currentRecord'); if ($formID) { return UserDefinedForm::get()->byID($formID); } @@ -460,7 +460,7 @@ class EmailRecipient extends DataObject } // Hack in currently edited page if context is missing if (Controller::has_curr() && Controller::curr() instanceof CMSMain) { - return Controller::curr()->currentPage(); + return Controller::curr()->currentRecord(); } // No page being edited diff --git a/code/Model/Recipient/EmailRecipientCondition.php b/code/Model/Recipient/EmailRecipientCondition.php index 760baf4..48b882c 100644 --- a/code/Model/Recipient/EmailRecipientCondition.php +++ b/code/Model/Recipient/EmailRecipientCondition.php @@ -143,7 +143,7 @@ class EmailRecipientCondition extends DataObject } // Hack in currently edited page if context is missing if (Controller::has_curr() && Controller::curr() instanceof CMSMain) { - return Controller::curr()->currentPage(); + return Controller::curr()->currentRecord(); } // No page being edited