Skip to content

Commit

Permalink
DOC Add warning about conditional sitetree edit forms (#680)
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli authored Jan 23, 2025
1 parent a1b0289 commit eae38e9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions en/08_Changelogs/6.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit eae38e9

Please sign in to comment.