Skip to content

Commit 184dad7

Browse files
API Deprecate API that's changing in CMS 6 (#1357)
* ENH Avoid using deprecated API * API Deprecate API that's changing in CMS 6
1 parent 76be354 commit 184dad7

File tree

6 files changed

+8
-7
lines changed

6 files changed

+8
-7
lines changed

code/Model/EditableCustomRule.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ protected function getCanCreateContext($args)
119119
}
120120
// Hack in currently edited page if context is missing
121121
if (Controller::has_curr() && Controller::curr() instanceof CMSMain) {
122-
return Controller::curr()->currentPage();
122+
return Controller::curr()->currentRecord();
123123
}
124124

125125
// No page being edited

code/Model/EditableFormField.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ public function canEdit($member = null)
509509
// This is to restore User Forms 2.x backwards compatibility.
510510
$controller = Controller::curr();
511511
if ($controller && $controller instanceof CMSPageEditController) {
512-
$parent = $controller->getRecord($controller->currentPageID());
512+
$parent = $controller->getRecord($controller->currentRecordID());
513513
// Only allow this behaviour on pages using UserFormFieldEditorExtension, such
514514
// as UserDefinedForm page type.
515515
if ($parent && $parent->hasExtension(UserFormFieldEditorExtension::class)) {
@@ -572,7 +572,7 @@ protected function getCanCreateContext($args)
572572
}
573573
// Hack in currently edited page if context is missing
574574
if (Controller::has_curr() && Controller::curr() instanceof CMSMain) {
575-
return Controller::curr()->currentPage();
575+
return Controller::curr()->currentRecord();
576576
}
577577

578578
// No page being edited

code/Model/Recipient/EmailRecipient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ protected function getCanCreateContext($args)
416416
}
417417
// Hack in currently edited page if context is missing
418418
if (Controller::has_curr() && Controller::curr() instanceof CMSMain) {
419-
return Controller::curr()->currentPage();
419+
return Controller::curr()->currentRecord();
420420
}
421421

422422
// No page being edited

code/Model/Recipient/EmailRecipientCondition.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ protected function getCanCreateContext($args)
143143
}
144144
// Hack in currently edited page if context is missing
145145
if (Controller::has_curr() && Controller::curr() instanceof CMSMain) {
146-
return Controller::curr()->currentPage();
146+
return Controller::curr()->currentRecord();
147147
}
148148

149149
// No page being edited

code/Model/UserDefinedForm.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@ class UserDefinedForm extends Page
1818

1919
/**
2020
* @var string
21+
* @deprecated 6.4.0 Will be renamed to cms_icon_class
2122
*/
2223
private static $icon_class = 'font-icon-p-list';
2324

2425
/**
2526
* @var string
26-
* @deprecated 5.4.0 use class_description instead.
27+
* @deprecated 6.4.0 use class_description instead.
2728
*/
2829
private static $description = 'Adds a customizable form.';
2930

tests/php/Form/GridFieldAddClassesButtonTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function testHandleAddUpdatesModifiedFormData()
3131
$request = new HTTPRequest('GET', '/');
3232
$request->setSession(new Session([]));
3333
$controller->setRequest($request);
34-
$controller->setCurrentPageID($udf->ID);
34+
$controller->setCurrentRecordID($udf->ID);
3535
$controller->pushCurrent();
3636
$list = new DataList(EditableFormField::class);
3737
$field = EditableTextField::create([

0 commit comments

Comments
 (0)