Add upgrade considerations

pull/13398/head
Sage Abdullah 2025-09-02 13:33:50 +01:00 zatwierdzone przez Matt Westcott
rodzic 5c26510f8a
commit d82172f0ab
5 zmienionych plików z 37 dodań i 3 usunięć

Wyświetl plik

@ -52,8 +52,8 @@ class SettingsBlock(blocks.StructBlock):
icon = 'cog'
# This block will be initially collapsed
collapsed = True
# The label when the block is collapsed
label_format = "Settings (Theme: {theme}, Available: {available})"
# The block's summary label when collapsed
label_format = "Theme: {theme}, Available: {available}"
class PersonBlock(blocks.StructBlock):

Wyświetl plik

@ -536,7 +536,10 @@ The `form_attrs` keyword argument was added to all built-in structural block typ
:param value_class: A subclass of ``wagtail.blocks.StructValue`` to use as the type of returned values for this block. See :ref:`custom_value_class_for_structblock`.
:param search_index: If false (default true), the content of this block will not be indexed for searching.
:param label_format:
Determines the label shown when the block is collapsed in the editing interface. By default, the value of the first sub-block in the StructBlock is shown, but this can be customized by setting a string here with block names contained in braces - for example ``label_format = "Profile for {first_name} {surname}"``
Determines the summary label shown after the ``label`` when the block is collapsed in the editing interface. By default, the value of the first sub-block in the StructBlock is shown, but this can be customized by setting a string here with block names contained in braces - for example ``label_format = "{surname}, {first_name}"``. If you wish to hide the summary label entirely, set this to the empty string ``""``.
.. versionchanged:: 7.1
The block's original ``label`` is now always shown when the block is collapsed, and the ``label_format`` string is shown after it as the summary instead of replacing the ``label``.
.. autoclass:: wagtail.blocks.ListBlock

Wyświetl plik

@ -0,0 +1,24 @@
# Wagtail 7.1.2 release notes
_Unreleased_
```{contents}
---
local:
depth: 1
---
```
## What's new
### Bug fixes
* Allow `label_format` to be set to an empty string to hide the block summary label (Sage Abdullah)
## Upgrade considerations - changes affecting all projects
### Changes to `label_format` behavior in `StructBlock`
In Wagtail 7.1, the `label_format` option for `StructBlock` has been changed to always show the block's original `label` when the block is collapsed, with the `label_format` string shown after it as a summary instead of replacing the `label`. This means that if you had previously set `label_format` to include (or be the same as) the `label`, you would likely want to remove the original `label`'s text from the `label_format` string.
If you wish to hide the summary label entirely (similar to setting `label_format = label` in Wagtail < 7.1), you can set `label_format` to the empty string `""`. This was not possible in Wagtail 7.1, but is now supported as of this release.

Wyświetl plik

@ -172,6 +172,12 @@ The panels mechanism used by the page and snippet editing forms now provides an
* Upgrade django-tasks to 0.8.x (Jake Howard)
* Refresh accessibility targets in contributing docs (Thibaud Colas)
## Upgrade considerations - changes affecting all projects
### Changes to `label_format` behavior in `StructBlock`
The `label_format` option for `StructBlock` has been changed to always show the block's original `label` when the block is collapsed, with the `label_format` string shown after it as a summary instead of replacing the `label`. This means that if you had previously set `label_format` to include (or be the same as) the `label`, you would likely want to remove the original `label`'s text from the `label_format` string.
## Upgrade considerations - changes affecting Wagtail customizations
### Deprecation of `PageListingButton`, `SnippetListingButton`, and `UserListingButton`

Wyświetl plik

@ -7,6 +7,7 @@ Release notes
upgrading
release_process
7.2
7.1.2
7.1.1
7.1
7.0.3