Skip to content

Commit

Permalink
DOC Show more information in ValidationException message
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Jan 16, 2025
1 parent b778111 commit 7be0d77
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions en/08_Changelogs/6.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ title: 6.0.0 (unreleased)
- [Update JS MIME type, remove `type` in `<script>` tags](#js-mime-type-update)
- [`getSchemaDataDefaults()` now includes attributes](#formfield-schema-data)
- [Remember me token rotation](#remember-me-token-rotation)
- [Validation exceptions shows additional info in some contexts](#validation-exception-info)
- [Full list of removed and changed API (by module, alphabetically)](#api-removed-and-changed)

## Change to commercially supported modules {#changes-to-support}
Expand Down Expand Up @@ -1146,6 +1147,14 @@ If you were calling `getSchemaData()` in your `getAttributes()` method in a `For

The related `onAfterRenewToken` extension hook has been renamed to `onAfterRenewSession`, and is triggered at the same logical step in the session renewal process.

### Validation exceptions shows additional info in some contexts {#validation-exception-info}

[`ValidationResult`](api:SilverStripe\Core\Validation\ValidationResult) now includes additional information about validation exceptions including the field name that failed validation, and if applicable the DataObject class and record ID. This additional information will be outputted by [`ValidationException`](api:SilverStripe\Core\Validation\ValidationException) if the validation exception happened in a CLI context, or in an HTTP context if the current controller is an instance of [`DevelopmentAdmin`](api:SilverStripe\Dev\DevelopmentAdmin) or a subclass of it.

This is done to help developers debug validation issues that happen outside of a UX context more easily, such as validation exceptions that occur during a `dev/build`.

The value of the field that failed validation is intentially not included in the output, as it could contain sensitive information e.g. an API token.

### Full list of removed and changed API (by module, alphabetically) {#api-removed-and-changed}

<!--- Changes below this line will be automatically regenerated -->
Expand Down

0 comments on commit 7be0d77

Please sign in to comment.