mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
Merge 317b6548d7
into 574ca14ee7
This commit is contained in:
commit
3c9f60f0a8
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user