Fix: Allow removing the Versioned extension from EditableFormField

fixes #1082
This commit is contained in:
GuySartorelli 2021-06-21 09:58:35 +12:00 committed by GitHub
parent e2f4378fff
commit 02c15f321a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -345,9 +345,11 @@ class EditableFormField extends DataObject
// make sure to migrate the class across (prior to v5.x)
DB::query("UPDATE \"EditableFormField\" SET \"ParentClass\" = 'Page' WHERE \"ParentClass\" IS NULL");
if (self::has_extension(Versioned::class)) {
DB::query("UPDATE \"EditableFormField_Live\" SET \"ParentClass\" = 'Page' WHERE \"ParentClass\" IS NULL");
DB::query("UPDATE \"EditableFormField_Versions\" SET \"ParentClass\" = 'Page' WHERE \"ParentClass\" IS NULL");
}
}
/**
* Return fields to display on the 'Display Rules' tab