Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC Add warning about conditional sitetree edit forms #680

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading