mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
Merge debd1d4499
into 574ca14ee7
This commit is contained in:
commit
6096c98b6a
@ -119,7 +119,7 @@ class EditableCustomRule extends DataObject
|
|||||||
}
|
}
|
||||||
// Hack in currently edited page if context is missing
|
// Hack in currently edited page if context is missing
|
||||||
if (Controller::has_curr() && Controller::curr() instanceof CMSMain) {
|
if (Controller::has_curr() && Controller::curr() instanceof CMSMain) {
|
||||||
return Controller::curr()->currentPage();
|
return Controller::curr()->currentRecord();
|
||||||
}
|
}
|
||||||
|
|
||||||
// No page being edited
|
// No page being edited
|
||||||
|
@ -509,7 +509,7 @@ class EditableFormField extends DataObject
|
|||||||
// This is to restore User Forms 2.x backwards compatibility.
|
// This is to restore User Forms 2.x backwards compatibility.
|
||||||
$controller = Controller::curr();
|
$controller = Controller::curr();
|
||||||
if ($controller && $controller instanceof CMSPageEditController) {
|
if ($controller && $controller instanceof CMSPageEditController) {
|
||||||
$parent = $controller->getRecord($controller->currentPageID());
|
$parent = $controller->getRecord($controller->currentRecordID());
|
||||||
// Only allow this behaviour on pages using UserFormFieldEditorExtension, such
|
// Only allow this behaviour on pages using UserFormFieldEditorExtension, such
|
||||||
// as UserDefinedForm page type.
|
// as UserDefinedForm page type.
|
||||||
if ($parent && $parent->hasExtension(UserFormFieldEditorExtension::class)) {
|
if ($parent && $parent->hasExtension(UserFormFieldEditorExtension::class)) {
|
||||||
@ -572,7 +572,7 @@ class EditableFormField extends DataObject
|
|||||||
}
|
}
|
||||||
// Hack in currently edited page if context is missing
|
// Hack in currently edited page if context is missing
|
||||||
if (Controller::has_curr() && Controller::curr() instanceof CMSMain) {
|
if (Controller::has_curr() && Controller::curr() instanceof CMSMain) {
|
||||||
return Controller::curr()->currentPage();
|
return Controller::curr()->currentRecord();
|
||||||
}
|
}
|
||||||
|
|
||||||
// No page being edited
|
// No page being edited
|
||||||
|
@ -228,7 +228,7 @@ class EmailRecipient extends DataObject
|
|||||||
// LeftAndMain::sessionNamespace is protected.
|
// LeftAndMain::sessionNamespace is protected.
|
||||||
$sessionNamespace = $this->config()->get('session_namespace') ?: CMSMain::class;
|
$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) {
|
if ($formID) {
|
||||||
return UserDefinedForm::get()->byID($formID);
|
return UserDefinedForm::get()->byID($formID);
|
||||||
}
|
}
|
||||||
@ -460,7 +460,7 @@ class EmailRecipient extends DataObject
|
|||||||
}
|
}
|
||||||
// Hack in currently edited page if context is missing
|
// Hack in currently edited page if context is missing
|
||||||
if (Controller::has_curr() && Controller::curr() instanceof CMSMain) {
|
if (Controller::has_curr() && Controller::curr() instanceof CMSMain) {
|
||||||
return Controller::curr()->currentPage();
|
return Controller::curr()->currentRecord();
|
||||||
}
|
}
|
||||||
|
|
||||||
// No page being edited
|
// No page being edited
|
||||||
|
@ -143,7 +143,7 @@ class EmailRecipientCondition extends DataObject
|
|||||||
}
|
}
|
||||||
// Hack in currently edited page if context is missing
|
// Hack in currently edited page if context is missing
|
||||||
if (Controller::has_curr() && Controller::curr() instanceof CMSMain) {
|
if (Controller::has_curr() && Controller::curr() instanceof CMSMain) {
|
||||||
return Controller::curr()->currentPage();
|
return Controller::curr()->currentRecord();
|
||||||
}
|
}
|
||||||
|
|
||||||
// No page being edited
|
// No page being edited
|
||||||
|
@ -19,7 +19,7 @@ class UserDefinedForm extends Page
|
|||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
private static $icon_class = 'font-icon-p-list';
|
private static $cms_icon_class = 'font-icon-p-list';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
|
Loading…
Reference in New Issue
Block a user