This commit is contained in:
Guy Sartorelli 2024-10-22 05:31:24 +13:00 committed by GitHub
commit 3c9f60f0a8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 6 additions and 6 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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