Skip to content

Commit 6409ed2

Browse files
API Deprecate UpgradePolymorphicExtension (#1405)
This legacy extension was made to resolve a compatibility problem between CMS 3 and 4, and can slow down the database build for large sites.
1 parent 3a2fde4 commit 6409ed2

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

code/Extension/UpgradePolymorphicExtension.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use SilverStripe\ORM\DataList;
99
use SilverStripe\ORM\DataObject;
1010
use SilverStripe\Core\Validation\ValidationException;
11+
use SilverStripe\Dev\Deprecation;
1112
use SilverStripe\UserForms\Model\EditableFormField;
1213
use SilverStripe\UserForms\Model\Recipient\EmailRecipient;
1314
use SilverStripe\UserForms\Model\Submission\SubmittedForm;
@@ -23,6 +24,7 @@
2324
* certain amount of manual checking is required to ensure that upgrades are performed smoothly.
2425
*
2526
* @extends Extension<UserDefinedForm>
27+
* @deprecated 6.1.0 Will be removed without equivalent functionality to replace it in a future major release.
2628
*/
2729
class UpgradePolymorphicExtension extends Extension
2830
{
@@ -45,9 +47,14 @@ class UpgradePolymorphicExtension extends Extension
4547
*/
4648
protected $defaultReplacement = UserDefinedForm::class;
4749

50+
public function __construct()
51+
{
52+
Deprecation::noticeWithNoReplacment('6.1.0');
53+
}
54+
4855
protected function onRequireDefaultRecords()
4956
{
50-
if (!UserDefinedForm::config()->get('upgrade_on_build')) {
57+
if (!Deprecation::withSuppressedNotice(fn () => UserDefinedForm::config()->get('upgrade_on_build'))) {
5158
return;
5259
}
5360

code/UserForm.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ trait UserForm
6969
*
7070
* @config
7171
* @var bool
72+
* @deprecated 6.1.0 Will be removed without equivalent functionality to replace it in a future major release.
7273
*/
7374
private static $upgrade_on_build = true;
7475

0 commit comments

Comments
 (0)