8.8 KiB
Wagtail 4.1 release notes - IN DEVELOPMENT
---
local:
depth: 1
---
Wagtail 4.1 is designated a Long Term Support (LTS) release. Long Term Support releases will continue to receive maintenance updates as necessary to address security and data-loss related issues, up until the next LTS release (typically a period of 12 months).
What's new
New UI for scheduled publishing
Scheduled publishing settings can now be found within the Status side panel of the page editing view. This change aims to improve clarity over who is able to set schedules, and when they take effect. This feature was developed by Sage Abdullah.
Customisable snippet admin views
The register_snippet
function now accepts a SnippetViewSet
class, allowing various aspects of the snippet's admin views to be customised. See . This feature was developed by Sage Abdullah.
Scheduled publishing for snippets
Snippet models that inherit from DraftStateMixin
can now be assigned go-live and expiry dates. This feature was developed by Sage Abdullah.
Object usage reporting
Images, documents and snippets now provide a usage report, listing the places where references to those objects appear. This report is powered by a new ReferenceIndex
model which records cross-references between objects whenever those objects to save; this allows it to work more efficiently than the old report available through the WAGTAIL_USAGE_COUNT_ENABLED
setting, as well as handling references within StreamField and rich text fields.
Note that on first upgrading to Wagtail 4.1, you will need to run the rebuild_references_index
management command to populate the references table and ensure that reference counts are displayed accurately.
This feature was developed by Karl Hobley and Matt Westcott.
Other features
- Add basic keyboard control and screen reader support for page listing re-ordering (Paarth Agarwal, Thomas van der Hoeven)
- Add
PageQuerySet.private
method as an alias ofnot_public
(Mehrdad Moradizadeh) - Most images in the admin will now only load once they are visible on screen (Jake Howard)
- Allow setting default attributes on image tags (Jake Howard)
- Optimise the performance of the Wagtail userbar to remove duplicated queries, improving page loads when viewing live pages while signed in (Jake Howard)
- Remove legacy styling classes for buttons and refactor button styles to be more maintainable (Paarth Agarwal, LB (Ben Johnston))
- Add button variations to the pattern library (Paarth Agarwal)
- Provide a more accessible page title where the unique information is shown first and the CMS name is shown last (Mehrdad Moradizadeh)
- Pull out behaviour from
AbstractFormField
toFormMixin
andAbstractEmailForm
toEmailFormMixin
to allow use with subclasses ofPage
(Mehrdad Moradizadeh, Kurt Wall) - Add a
docs.wagtail.org/.well-known/security.txt
so that the security policy is available as per the specification on https://securitytxt.org/ (Jake Howard) - Add unit tests for the
classnames
Wagtail admin template tag (Mehrdad Moradizadeh) - Show an inverse locked indicator when the page has been locked by the current user in reports and dashboard listings (Vaibhav Shukla, LB (Ben Johnston))
- Add clarity to the development documentation that
admonition
should not be used and titles fornote
are not supported, including clean up of some existing incorrect usage (LB (Ben Johnston)) - Unify the styling of delete/destructive button styles across the admin interface (Paarth Agarwal)
- Adopt new designs and unify the styling styles for
.button-secondary
buttons across the admin interface (Paarth Agarwal) - Refine designs for disabled buttons throughout the admin interface (Paarth Agarwal)
- Update expanding formset add buttons to use
button
not link for behaviour and remove support for disabled as a class (LB (Ben) Johnston) - Add robust unit testing for authentication scenarios across the user management admin pages (Mehrdad Moradizadeh)
- Avoid assuming an integer PK named 'id' on multiple upload views (Matt Westcott)
- Add a toggle to collapse/expand all page panels at once (Helen Chapman)
- Improve the GitHub Workflows (CI) security (Alex (sashashura))
- Use
search
type input in documentation search (LB (Ben) Johnston) - Render
help_text
when set onFieldPanel
,MultiFieldPanel
,FieldRowPanel
, and other panel APIs where it previously worked without official support (Matt Westcott) - Consolidate usage of Excel libraries to a single library
openpyxl
, removing usage ofXlsxWriter
,tablib
,xlrd
andxlwt
(Jaap Roes) - Adopt generic class based views for the create User create view, User edit view, user delete view and Users index listing / search results (Mehrdad Moradizadeh)
- Add
button-secondary bicolor
variants to the pattern library and styleguide (Adinapunyo Banerjee) - Add better support for non-integer / non-
id
primary keys into Wagtail's generic views, including for custom Snippets and User models (Mehrdad Moradizadeh)
Bug fixes
- Prevent
PageQuerySet.not_public
from returning all pages when no page restrictions exist (Mehrdad Moradizadeh) - Ensure that duplicate block ids are unique when duplicating stream blocks in the page editor (Joshua Munn)
- Revise colour usage so that privacy & locked indicators can be seen in Windows High Contrast mode (LB (Ben Johnston))
- Ensure that disabled buttons have a consistent presentation on hover to indicate no interaction is available (Paarth Agarwal)
- Update the 'Locked pages' report menu title so that it is consistent with other pages reports and its own title on viewing (Nicholas Johnson)
- Support
formfield_callback
handling onModelForm.Meta
for future Django 4.2 release (Matt Westcott) - Ensure that
ModelAdmin
correctly supports filters in combination with subsequent searches without clearing the applied filters (Stefan Hammer) - Add missing translated values to site settings' headers plus models presented in listings and audit report filtering labels (Stefan Hammer)
- Remove
capitalize()
calls to avoid issues with other languages or incorrectly presented model names for reporting and parts of site settings (Stefan Hammer) - Add back rendering of
help_text
for InlinePanel (Matt Westcott) - Ensure
for_user
argument is passed to the form class when previewing pages (Matt Westcott) - Ensure the capitalisation of the
timesince_simple
tag is consistently added in the template based on usage in context (Stefan Hammer) - Add missing translation usage for the
timesince_last_update
and ensure the translated labels can be easier to work with in Transifex (Stefan Hammer) - Add additional checks for duplicate form field
clean_name
values in the Form Builder validation and increase performance of checks (Dan Bentley) - Use correct color for labels of radio and checkbox fields (Steven Steinwand)
- Adjust spacing of fields’ error messages and position in tables (Steven Steinwand)
- Update dead or redirected links throughout the documentation (LB (Ben) Johnston)
Upgrade considerations
rebuild_references_index
management command
After upgrading, you will need to run ./manage.py rebuild_references_index
in order to populate the references table and ensure that usage counts for images, documents and snippets are displayed accurately.
Button styling class changes
The button-secondary
class is no longer compatible with either the .serious
or .no
classes, this partially worked previously but is no longer officially supported.
When adding custom buttons using the ModelAdmin
ButtonHelper
class, custom buttons will no longer include the button-secondary
class by default in index listings.
If using the hook register_user_listing_buttons
to register buttons along with the undocumented UserListingButton
class, the button-secondary
class will no longer be included by default.
Avoid using disabled
as a class on button
elements, instead use the disabled
attribute as support for this as a class may be removed in a future version of Wagtail and is not accessible.
If using custom expanding-formset
the add button will no longer support the disabled
class but instead must require the disabled
attribute to be set.
The following button classes have been removed, none of which were being used within the admin but may have been used by custom code or packages:
button-neutral
button-strokeonhover
hover-no
unbutton
yes
Dropped support for importing .xls
Spreadsheet files into Redirects
.xls
legacy Microsoft Excel 97-2003 spreadsheets will no longer be supported for importing into the contrib Redirects listing..xlsx
,.csv
,.tsv
formats are still supported.