From 89edcdaa86e94aa9f9747d5feadb201bf84ea3eb Mon Sep 17 00:00:00 2001 From: Guy Sartorelli Date: Thu, 23 Jan 2025 14:51:38 +1300 Subject: [PATCH] DOC Add warning about conditional sitetree edit forms --- en/08_Changelogs/6.0.0.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/en/08_Changelogs/6.0.0.md b/en/08_Changelogs/6.0.0.md index 8993bea5..919ff100 100644 --- a/en/08_Changelogs/6.0.0.md +++ b/en/08_Changelogs/6.0.0.md @@ -510,6 +510,13 @@ class MyCustomPage extends Page } ``` +> [!WARNING] +> You might currently have form fields that are only added if some condition is true, for example if the user has certain permissions. If you change nothing, those fields will likely display for all users editing the record. +> You can make the fields only appear conditionally by doing one of the following: +> +> - Reverse the condition - if you are currently adding a field if some condition is true, change your logic so you instead remove the scaffolded form field if that condition is false. +> - Use the `scaffold_cms_fields_settings` configuration to ensure those form fields are not scaffolded. You can then leave your logic as is for those fields. + See the [scaffolding](/developer_guides/model/scaffolding/#scaffolding-options) section for more details about using these options. As part of your CMS 6 upgrade, you should check all of the page types in your project and in any modules you maintain to ensure the correct form fields are available in the appropriate tabs. You should also check [`Extension`](api:SilverStripe\Core\Extension) subclasses that you know get applied to pages to ensure fields aren't being scaffolded from those that you want to keep hidden.