NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI, #4986 most downloaded on PyPI
A Django content management system.
Latest stable
8.1
Last release 15 days ago
02 Nov 2026
Release timing varies
gaps range from 9 days to 2 months
Nearly every release is documented
notes for 60 of the last 60 stable releases
1 version withdrawn
withdrawn after publishing
13 years old
305 releases · first in 2014
Drag across the ruler to compare, or tap a release to open it.
Fix: CVE-2023-28836 - Stored XSS attack via ModelAdmin views (Thibaud Colas)
TemplateResponses for users with a custom timezone (Stefan Hammer, Sage Abdullah)MultipleChooserPanel in panel reference docsApril 3, 2023
---
local:
depth: 1
---
This release addresses a stored cross-site scripting (XSS) vulnerability on ModelAdmin views within the Wagtail admin interface. A user with a limited-permission editor account for the Wagtail admin could potentially craft pages and documents that, when viewed by a user with higher privileges, could perform actions with that user's credentials. The vulnerability is not exploitable by an ordinary site visitor without access to the Wagtail admin, and only affects sites with ModelAdmin enabled.
Many thanks to Thibaud Colas for reporting this issue. For further details, please see the CVE-2023-28836 security advisory.
This release addresses a memory exhaustion bug in Wagtail's handling of uploaded images and documents. For both images and documents, files are loaded into memory during upload for additional processing. A user with access to upload images or documents through the Wagtail admin interface could upload a file so large that it results in a crash or denial of service.
The vulnerability is not exploitable by an ordinary site visitor without access to the Wagtail admin. It can only be exploited by admin users with permission to upload images or documents.
Many thanks to Jake Howard for reporting this issue. For further details, please see the CVE-2023-28837 security advisory.
TemplateResponses for users with a custom timezone (Stefan Hammer, Sage Abdullah)MultipleChooserPanel in panel reference docsYour coding agent can read these notes before it upgrades. Set up the MCP server →
Fix: Support creating StructValue copies (Tidiane Dia)
StructValue copies (Tidiane Dia)GroupApprovalTask if it's locked by someone outside of the group (Sage Abdullah)wagtail.schedule.cancel (Stefan Hammer)require_admin_access() (Stefan Hammer)ClusterableModel requirements for using relations with RevisionMixin-enabled models (Sage Abdullah)March 13, 2023
---
local:
depth: 1
---
StructValue copies (Tidiane Dia)GroupApprovalTask if it's locked by someone outside of the group (Sage Abdullah)wagtail.schedule.cancel (Stefan Hammer)require_admin_access() (Stefan Hammer)ClusterableModel requirements for using relations with RevisionMixin-enabled models (Sage Abdullah)Maintenance: Add deprecation warnings for wagtail.core and other imports deprecated in Wagtail 3.0 (Matt Westcott)
LockableMixin (Sage Abdullah)WorkflowMixin (Sage Abdullah){% fullpageurl %} tag for getting the absolute URL of a page (Jake Howard)MultipleChooserPanel, a variant of InlinePanel with improved editor experience when inserting multiple linked objects (Matt Westcott)WagtailPageTestCase.assertCanCreate now supports the kwarg publish=True to determine whether to publish the page (Harry Percival, Akua Dokua Asiedu, Matt Westcott)rebuild_references_index command can run without console output if called with --verbosity 0 (Omerzahid Ali, Aman Pandey)button bicolor button--icon button-secondary including the button-small variant (Seremba Patrick)purge_embeds management command to delete all the cached embed objects in the database (Aman Pandey)form_fields as an APIField on FormPage (Sævar Öfjörð Magnússon, Suyash Singh, LB (Ben) Johnston)DraftStateMixin now automatically define a "Publish" permission type (Sage Abdullah)azure-mgmt-cdn version >= 10 and azure-mgmt-frontdoor version >= 1 in the frontend cache invalidator (Sylvain Fankhauser)django-storages backend is configured to allow overwriting (Rishabh jain)construct_wagtail_userbar hook (Sage Abdullah)InlinePanel inner fields to avoid lost or incorrectly linked comments (Jacob Topp-Mugglestone)WAGTAILIMAGES_FEATURE_DETECTION_ENABLED to avoid errors for images that do not exist (Aman Pandey)cc, bcc and reply_to to the Django mail helper from wagtail.admin.mail.send_mail (Ben Gosney)DecimalBlock correctly handles None, when required=False, values (Natarajan Balaji)delete_url_name attribute in generic DeleteView (Alex Simpson)wagtail.search.utils.parse_query_string (Beniamin Bucur)workflow_state_approved.html template (Alex Tomkins)latest_revision pointer from being copied over when copying translatable snippets for translation (Sage Abdullah)fnm over nvm in development documentation (LB (Ben) Johnston)request and current_site to get_url on the performance documentation page (Jake Howard)register_user_listing_buttons hook (LB (Ben Johnston))page models usage guide (Damilola Oladele)register_image_operations and add an example of a custom Image filter (Coen van der Kamp)RichTextField (Matt Westcott)renderer_classes (Aman Pandey)testapp migrations (Matt Westcott)escapeHtml function (Jordan Rob)initButtonSelects from core.js to own TypesScript file and add unit tests (Loveth Omokaro)initSkipLink util to TypeScript and add JSDoc & unit tests (Juliet Adeboye)unlist to Tailwind utility class w-list-none (Loveth Omokaro)hasOwn in TypeScript (Loveth Omokaro)initTooltips to TypeScript add JSDoc and unit tests (Fatuma Abdullahi)initTagField from core.js to own TypeScript file and add unit tests (Chisom Okeoma)initDissmisibles (Yekasumah)classname for passing HTML class attributes (LB (Ben Johnston))InlinePanel JavaScript initialisation code and adopt a class approach (Matt Westcott)identity JavaScript util into shared utils folder (LB (Ben Johnston))URLSearchParams (Loveth Omokaro)tsconfig to better support modern TypeScript development and clean up some code quality issues via Eslint (Loveth Omokaro)wagtail.admin.panels into submodules, existing exports have been preserved (Matt Westcott)wagtail.core and other imports deprecated in Wagtail 3.0 (Matt Westcott)avatar component with a template tag include {% avatar ... %} throughout the admin interface (Aman Pandey)LockableMixin (Sage Abdullah)WorkflowMixin (Sage Abdullah){% fullpageurl %} tag for getting the absolute URL of a page (Jake Howard)MultipleChooserPanel, a variant of InlinePanel with improved editor experience when inserting multiple linked objects (Matt Westcott)WagtailPageTestCase.assertCanCreate now supports the kwarg publish=True to determine whether to publish the page (Harry Percival, Akua Dokua Asiedu, Matt Westcott)rebuild_references_index command can run without console output if called with --verbosity 0 (Omerzahid Ali, Aman Pandey)button bicolor button--icon button-secondary including the button-small variant (Seremba Patrick)purge_embeds management command to delete all the cached embed objects in the database (Aman Pandey)form_fields as an APIField on FormPage (Sævar Öfjörð Magnússon, Suyash Singh, LB (Ben) Johnston)DraftStateMixin now automatically define a "Publish" permission type (Sage Abdullah)azure-mgmt-cdn version >= 10 and azure-mgmt-frontdoor version >= 1 in the frontend cache invalidator (Sylvain Fankhauser)django-storages backend is configured to allow overwriting (Rishabh jain)construct_wagtail_userbar hook (Sage Abdullah)InlinePanel inner fields to avoid lost or incorrectly linked comments (Jacob Topp-Mugglestone)WAGTAILIMAGES_FEATURE_DETECTION_ENABLED to avoid errors for images that do not exist (Aman Pandey)cc, bcc and reply_to to the Django mail helper from wagtail.admin.mail.send_mail (Ben Gosney)DecimalBlock correctly handles None, when required=False, values (Natarajan Balaji)delete_url_name attribute in generic DeleteView (Alex Simpson)wagtail.search.utils.parse_query_string (Beniamin Bucur)workflow_state_approved.html template (Alex Tomkins)latest_revision pointer from being copied over when copying translatable snippets for translation (Sage Abdullah)fnm over nvm in development documentation (LB (Ben) Johnston)request and current_site to get_url on the performance documentation page (Jake Howard)register_user_listing_buttons hook (LB (Ben Johnston))page models usage guide (Damilola Oladele)register_image_operations and add an example of a custom Image filter (Coen van der Kamp)RichTextField (Matt Westcott)renderer_classes (Aman Pandey)SettingsPanel reference in the page editing TabbedInterface example as SettingsPanel no longer shows anything as of 4.1 (Kenny Wolf, Julian Bigler)permission kwarg support in Panels (LB (Ben) Johnston)testapp migrations (Matt Westcott)escapeHtml function (Jordan Rob)initButtonSelects from core.js to own TypeScript file and add unit tests (Loveth Omokaro)initSkipLink util to TypeScript and add JSDoc & unit tests (Juliet Adeboye)unlist to Tailwind utility class w-list-none (Loveth Omokaro)hasOwn in TypeScript (Loveth Omokaro)initTooltips to TypeScript and add JSDoc and unit tests (Fatuma Abdullahi)initTagField from core.js to own TypeScript file and add unit tests (Chisom Okeoma)initDismissibles (Yekasumah)classname for passing HTML class attributes (LB (Ben Johnston))InlinePanel JavaScript initialization code and adopt a class approach (Matt Westcott)identity JavaScript util into shared utils folder (LB (Ben Johnston))URLSearchParams (Loveth Omokaro)tsconfig to better support modern TypeScript development and clean up some code quality issues via Eslint (Loveth Omokaro)wagtail.admin.panels into submodules, existing exports have been preserved (Matt Westcott)wagtail.core and other imports deprecated in Wagtail 3.0 (Matt Westcott)avatar component with a template tag include {% avatar ... %} throughout the admin interface (Aman Pandey)icon-help and help-inverse code (Thibaud Colas)c-, o-, u-, t-, is- prefixes (Thibaud Colas)3.2, 4.0, 4.1
3.7, 3.8, 3.9, 3.10, 3.11
4.1 LTS
3.2, 4.0, 4.1
3.7, 3.8, 3.9, 3.10, 3.11
February 6, 2023
---
local:
depth: 1
---
Wagtail now provides a set of utilities for creating data migrations on StreamField data. For more information, see StreamField data migrations. This feature was developed by Sandil Ranasinghe, initially as the wagtail-streamfield-migration-toolkit add-on package, as part of the Google Summer of Code 2022 initiative, with support from Jacob Topp-Mugglestone, Joshua Munn and Karl Hobley.
Snippets can now be locked by users to prevent other users from editing, through the use of the LockableMixin. For more details, see .
This feature was developed by Sage Abdullah.
Snippets can now be assigned to workflows through the use of the WorkflowMixin, allowing new changes to be submitted for moderation before they are published. For more details, see .
This feature was developed by Sage Abdullah.
fullpageurl template tagWagtail now provides a fullpageurl template tag (for both Django templates and Jinja2) to output a page's full URL including the domain. For more details, see .
This feature was developed by Jake Howard.
Wagtail now uses the Stimulus framework for client-side interactivity (see RFC 78). Our Outreachy contributor Loveth Omokaro has refactored significant portions of the admin interface:
Those changes improve the maintainability of the code, and help us move towards compatibility with strict CSP (Content Security Policy) rules. Thank you to Loveth and project mentors LB (Ben) Johnston, Thibaud Colas, and Paarth Agarwal.
The CMS now includes an accessibility checker in the user bar, to assist users in building more accessible websites and follow ATAG 2.0 guidelines. The checker, which is based on the Axe testing engine, is designed for content authors to identify and fix accessibility issues on their own. It scans the loaded page for errors and displays the results, with three rules turned on in this release. It’s configurable with the construct_wagtail_userbar hook.
This new feature was implemented by Albina Starykova as part of an Outreachy internship, with support from mentors Thibaud Colas, Sage Abdullah, and Joshua Munn.
Following feedback from Wagtail users on rich text UI improvements in Wagtail 4.0, we have further refined the behavior of rich text fields to cater for different scenarios:
Thank you to all who provided feedback, participants to our usability testing sessions, and to Nick Lee and Thibaud Colas for the implementation.
A new panel type is available. This is a variant of InlinePanel which improves the editor experience when adding large numbers of linked items - rather than creating and populating each sub-form individually, a chooser modal is opened allowing multiple objects to be selected at once.
This feature was developed by Matt Westcott, and sponsored by YouGov.
WagtailPageTestCase.assertCanCreate now supports the kwarg publish=True to determine whether to publish the page (Harry Percival, Akua Dokua Asiedu, Matt Westcott)rebuild_references_index command can run without console output if called with --verbosity 0 (Omerzahid Ali, Aman Pandey)button bicolor button--icon button-secondary including the button-small variant (Seremba Patrick)purge_embeds management command to delete all the cached embed objects in the database (Aman Pandey)form_fields as an APIField on FormPage (Sævar Öfjörð Magnússon, Suyash Singh, LB (Ben) Johnston)DraftStateMixin now automatically define a "Publish" permission type (Sage Abdullah)azure-mgmt-cdn version >= 10 and azure-mgmt-frontdoor version >= 1 in the frontend cache invalidator (Sylvain Fankhauser)django-storages backend is configured to allow overwriting (Rishabh Jain)ChooserBlock.extract_references uses the model class, not the model string (Alex Tomkins)InlinePanel inner fields to avoid lost or incorrectly linked comments (Jacob Topp-Mugglestone)WAGTAILIMAGES_FEATURE_DETECTION_ENABLED to avoid errors for images that do not exist (Aman Pandey)cc, bcc and reply_to to the Django mail helper from wagtail.admin.mail.send_mail (Ben Gosney)DecimalBlock correctly handles None, when required=False, values (Natarajan Balaji)delete_url_name attribute in generic DeleteView (Alex Simpson)wagtail.search.utils.parse_query_string (Beniamin Bucur)latest_revision pointer from being copied over when copying translatable snippets for translation (Sage Abdullah)fnm over nvm in development documentation (LB (Ben) Johnston)request and current_site to get_url on the performance documentation page (Jake Howard)register_user_listing_buttons hook (LB (Ben Johnston))page models usage guide (Damilola Oladele)register_image_operations and add an example of a custom Image filter (Coen van der Kamp)RichTextField (Matt Westcott)renderer_classes (Aman Pandey)testapp migrations (Matt Westcott)escapeHtml function (Jordan Rob)initButtonSelects from core.js to own TypeScript file and add unit tests (Loveth Omokaro)initSkipLink util to TypeScript and add JSDoc & unit tests (Juliet Adeboye)unlist to Tailwind utility class w-list-none (Loveth Omokaro)hasOwn in TypeScript (Loveth Omokaro)initTooltips to TypeScript and add JSDoc and unit tests (Fatuma Abdullahi)initTagField from core.js to own TypeScript file and add unit tests (Chisom Okeoma)initDismissibles (Yekasumah)classname for passing HTML class attributes (LB (Ben Johnston))InlinePanel JavaScript initialization code and adopt a class approach (Matt Westcott)identity JavaScript util into shared utils folder (LB (Ben Johnston))URLSearchParams (Loveth Omokaro)tsconfig to better support modern TypeScript development and clean up some code quality issues via Eslint (Loveth Omokaro)wagtail.admin.panels into submodules, existing exports have been preserved (Matt Westcott)wagtail.core and other imports deprecated in Wagtail 3.0 (Matt Westcott)avatar component with a template tag include {% avatar ... %} throughout the admin interface (Aman Pandey)WagtailImageField)The AbstractImage and AbstractRendition models use a Wagtail-specific WagtailImageField which extends Django's ImageField
to use Willow for image file handling. This will generate a new migration if you
are using a custom image model.
InlinePanel not supportedWhen the commenting system was introduced, support for InlinePanel fields was incorrectly added. This has led to issues
where comments can be lost on save, or in most cases will be added to the incorrect item within the InlinePanel. The ability
to add comments here has now been removed and as such any existing comments that were added will no longer show.
See https://github.com/wagtail/wagtail/issues/9685 for tracking of adding this back officially in the future.
classname convention for some template tags & includesSome undocumented Wagtail admin template tags and includes have been refactored to adopt a more consistent naming of classname.
If these are used within packages or customizations they will need to be updated to the new variable naming convention.
| Name | New (classname) |
Old (various) |
|---|---|---|
icon (see note) |
{% icon name='spinner' classname='...' %} |
{% icon name='spinner class_name='...' %} |
dialog_toggle |
{% dialog_toggle classname='...' %} |
{% dialog_toggle class_name='...' %} |
paginate |
{% paginate pages classname="..." %} |
{% paginate pages classnames="..." %} |
tab_nav_link |
{% include 'wagtailadmin/shared/tabs/tab_nav_link.html' with classname="..." %} |
{% include 'wagtailadmin/shared/tabs/tab_nav_link.html' with classes="..." %} |
side_panel_button |
{% include 'wagtailadmin/shared/side_panels/includes/side_panel_button.html' with classname="..." %} |
{% include 'wagtailadmin/shared/side_panels/includes/side_panel_button.html' with classes="..." %} |
Note that the icon template tag will still support class_name with a deprecation warning. Support will be dropped in a future release.
InlinePanel JavaScript function is now a classThe (internal, undocumented) InlinePanel JavaScript function, used to initialize client-side behavior for inline panels, has been converted to a class. Any user code that calls this function should now replace InlinePanel(...) calls with new InlinePanel(...). Additionally, child form controls are now initialized automatically, and so it is no longer necessary to call initChildControls, updateChildCount, updateMoveButtonDisabledStates or updateAddButtonState.
Python code that uses the InlinePanel panel type is not affected by this change.
WAGTAILADMIN_GLOBAL_PAGE_EDIT_LOCK setting is now WAGTAILADMIN_GLOBAL_EDIT_LOCKThe WAGTAILADMIN_GLOBAL_PAGE_EDIT_LOCK setting has been renamed to WAGTAILADMIN_GLOBAL_EDIT_LOCK.
The wagtailuserbar template tag now initializes the userbar as a Web Component, with a wagtail-userbar custom element using shadow DOM to apply styles without any collisions with the host page.
For any site customizing the position of the userbar, target the styles to wagtail-userbar::part(userbar) instead of .wagtail-userbar. For example:
wagtail-userbar::part(userbar) {
bottom: 30px;
}
Like other userbar items, the new accessibility checker is configurable with the construct_wagtail_userbar hook. For example, to remove the new item, use:
from wagtail.admin.userbar import AccessibilityItem
@hooks.register("construct_wagtail_userbar")
def remove_userbar_accessibility_checks(request, items):
items[:] = [item for item in items if not isinstance(item, AccessibilityItem)]
azure-mgmt-cdn and azure-mgmt-frontdoor packages will be droppedIf you are using the front-end cache invalidator module (wagtail.contrib.frontend_cache) with Azure CDN or Azure Front Door, the following packages need to be updated:
azure-mgmt-cdn to version 10 or aboveazure-mgmt-frontdoor to version 1 or aboveSupport for older versions will be dropped in a future release.
Workflow and Task methodsTo accommodate workflows support for snippets, the page parameter in {meth}Workflow.start() <wagtail.models.Workflow.start> has been renamed to obj.
In addition, some methods on the base {class}~wagtail.models.Task model have been changed. If you have {doc}custom Task types </extending/custom_tasks>, make sure to update the methods to reflect the following changes:
page_locked_for_user() is now {meth}~wagtail.models.Task.locked_for_user. Using page_locked_for_user() is deprecated and will be removed in a future release.page parameter in user_can_access_editor(), locked_for_user(), user_can_lock(), user_can_unlock(), get_actions(), has been renamed to obj.WorkflowState and TaskState modelsTo accommodate workflows support for snippets, the WorkflowState.page foreign key has been replaced with a GenericForeignKey as WorkflowState.content_object. The generic foreign key is defined using a combination of the new WorkflowState.base_content_type and WorkflowState.object_id fields.
The TaskState.page_revision foreign key has been renamed to TaskState.revision.
wagtail.admin.forms.search.SearchForm validation logicThe wagtail.admin.forms.search.SearchForm class (which is internal and undocumented, but may be in use by applications that extend the Wagtail admin) no longer treats an empty search field as invalid. Any code that checks form.is_valid to determine whether or not to apply a search() filter to a queryset should now explicitly check that form.cleaned_data["q"] is non-empty.
Maintenance: Add deprecation warnings for wagtail.core and other imports deprecated in Wagtail 3.0 (Matt Westcott)
LockableMixin (Sage Abdullah)WorkflowMixin (Sage Abdullah){% fullpageurl %} tag for getting the absolute URL of a page (Jake Howard)MultipleChooserPanel, a variant of InlinePanel with improved editor experience when inserting multiple linked objects (Matt Westcott)WagtailPageTestCase.assertCanCreate now supports the kwarg publish=True to check publish redirection (Harry Percival, Akua Dokua Asiedu)rebuild_references_index command can run without console output if called with --verbosity 0 (Omerzahid Ali, Aman Pandey)button bicolor button--icon button-secondary including the button-small variant (Seremba Patrick)purge_embeds management command to delete all the cached embed objects in the database (Aman Pandey)form_fields as an APIField on FormPage (Sævar Öfjörð Magnússon, Suyash Singh, LB (Ben) Johnston)DraftStateMixin now automatically define a "Publish" permission type (Sage Abdullah)azure-mgmt-cdn version >= 10 and azure-mgmt-frontdoor version >= 1 in the frontend cache invalidator (Sylvain Fankhauser)django-storages backend is configured to allow overwriting (Rishabh jain)construct_wagtail_userbar hook (Sage Abdullah)InlinePanel inner fields to avoid lost or incorrectly linked comments (Jacob Topp-Mugglestone)WAGTAILIMAGES_FEATURE_DETECTION_ENABLED to avoid errors for images that do not exist (Aman Pandey)cc, bcc and reply_to to the Django mail helper from wagtail.admin.mail.send_mail (Ben Gosney)DecimalBlock correctly handles None, when required=False, values (Natarajan Balaji)delete_url_name attribute in generic DeleteView (Alex Simpson)wagtail.search.utils.parse_query_string (Beniamin Bucur)fnm over nvm in development documentation (LB (Ben) Johnston)request and current_site to get_url on the performance documentation page (Jake Howard)register_user_listing_buttons hook (LB (Ben Johnston))page models usage guide (Damilola Oladele)register_image_operations and add an example of a custom Image filter (Coen van der Kamp)RichTextField (Matt Westcott)renderer_classes (Aman Pandey)testapp migrations (Matt Westcott)escapeHtml function (Jordan Rob)initButtonSelects from core.js to own TypesScript file and add unit tests (Loveth Omokaro)initSkipLink util to TypeScript and add JSDoc & unit tests (Juliet Adeboye)unlist to Tailwind utility class w-list-none (Loveth Omokaro)hasOwn in TypeScript (Loveth Omokaro)initTooltips to TypeScript add JSDoc and unit tests (Fatuma Abdullahi)initTagField from core.js to own TypeScript file and add unit tests (Chisom Okeoma)initDissmisibles (Yekasumah)classname for passing HTML class attributes (LB (Ben Johnston))InlinePanel JavaScript initialisation code and adopt a class approach (Matt Westcott)identity JavaScript util into shared utils folder (LB (Ben Johnston))URLSearchParams (Loveth Omokaro)tsconfig to better support modern TypeScript development and clean up some code quality issues via Eslint (Loveth Omokaro)wagtail.admin.panels into submodules, existing exports have been preserved (Matt Westcott)wagtail.core and other imports deprecated in Wagtail 3.0 (Matt Westcott)avatar component with a template tag include {% avatar ... %} throughout the admin interface (Aman Pandey)Fix: CVE-2023-45809: Disclosure of user names via admin bulk action views (Matt Westcott)
October 19, 2023
---
local:
depth: 1
---
This release addresses an information disclosure vulnerability in the Wagtail admin interface. A user with a limited-permission editor account for the Wagtail admin can make a direct URL request to the admin view that handles bulk actions on user accounts. While authentication rules prevent the user from making any changes, the error message discloses the display names of user accounts, and by modifying URL parameters, the user can retrieve the display name for any user. The vulnerability is not exploitable by an ordinary site visitor without access to the Wagtail admin.
Many thanks to quyenheu for reporting this issue. For further details, please see the CVE-2023-45809 security advisory.
Maintenance: Additionally update Pillow dependency to allow use of versions with security fixes (Dan Braghis)
September 28, 2023
---
local:
depth: 1
---
Maintenance: Relax Willow dependency to allow use of current Pillow versions with security fixes (Dan Braghis)
September 27, 2023
---
local:
depth: 1
---
Fix: Rectify previous fix for TableBlock becoming uneditable after save (Sage Abdullah)
log_action parameter on RevisionMixin.save_revision (Christer Jensen)May 25, 2023
---
local:
depth: 1
---
log_action parameter on RevisionMixin.save_revision (Christer Jensen)Fix: Prevent TableBlock from becoming uneditable after save (Sage Abdullah)
May 2, 2023
---
local:
depth: 1
---
Fix: CVE-2023-28836 - Stored XSS attack via ModelAdmin views (Thibaud Colas)
TemplateResponses for users with a custom timezone (Stefan Hammer, Sage Abdullah)April 3, 2023
---
local:
depth: 1
---
This release addresses a stored cross-site scripting (XSS) vulnerability on ModelAdmin views within the Wagtail admin interface. A user with a limited-permission editor account for the Wagtail admin could potentially craft pages and documents that, when viewed by a user with higher privileges, could perform actions with that user's credentials. The vulnerability is not exploitable by an ordinary site visitor without access to the Wagtail admin, and only affects sites with ModelAdmin enabled.
Many thanks to Thibaud Colas for reporting this issue. For further details, please see the CVE-2023-28836 security advisory.
This release addresses a memory exhaustion bug in Wagtail's handling of uploaded images and documents. For both images and documents, files are loaded into memory during upload for additional processing. A user with access to upload images or documents through the Wagtail admin interface could upload a file so large that it results in a crash or denial of service.
The vulnerability is not exploitable by an ordinary site visitor without access to the Wagtail admin. It can only be exploited by admin users with permission to upload images or documents.
Many thanks to Jake Howard for reporting this issue. For further details, please see the CVE-2023-28837 security advisory.
TemplateResponses for users with a custom timezone (Stefan Hammer, Sage Abdullah)Fix: Add right-to-left (RTL) support for the following form components: Switch, Minimap, live preview (Thibaud Colas)
StructValue copies (Tidiane Dia)wagtail.schedule.cancel (Stefan Hammer)require_admin_access() (Stefan Hammer)ClusterableModel requirements for using relations with RevisionMixin-enabled models (Sage Abdullah)March 13, 2023
---
local:
depth: 1
---
StructValue copies (Tidiane Dia)wagtail.schedule.cancel (Stefan Hammer)require_admin_access() (Stefan Hammer)ClusterableModel requirements for using relations with RevisionMixin-enabled models (Sage Abdullah)Fix: Make "Cancel scheduled publish" button correctly redirect back to the edit view (Sage Abdullah)
PreviewableMixin applied (Sage Abdullah)latest_revision pointer from being copied over when copying translatable snippets for translation (Sage Abdullah)February 6, 2023
---
local:
depth: 1
---
PreviewableMixin applied (Sage Abdullah)latest_revision pointer from being copied over when copying translatable snippets for translation (Sage Abdullah)Fix: Fix issue where lock/unlock buttons would not work on the Dashboard (home) page or the page index listing via the status sidebar (Stefan Hammer)
verbose_name property from breaking usage report views (Matt Westcott)CSRF_HEADER_NAME setting (Sage Abdullah)November 11, 2022
---
local:
depth: 1
---
verbose_name property from breaking usage report views (Matt Westcott)CSRF_HEADER_NAME setting (Sage Abdullah)New scheduled publishing UI, available from the Status side panel (Sage Abdullah)
SnippetViewSet (Sage Abdullah)DraftStateMixin (Sage Abdullah)PageQuerySet.private method as an alias of not_public (Mehrdad Moradizadeh)unbutton, button-neutral, button-strokeonhover, hover-no, yes) and refactor button styles to be more maintainable (Paarth Agarwal, LB (Ben Johnston))AbstractFormField to FormMixin and AbstractEmailForm to EmailFormMixin to allow use with subclasses of Page (Mehrdad Moradizadeh, Kurt Wall)docs.wagtail.org/.well-known/security.txt so that the security policy is available as per the specification on https://securitytxt.org/ (Jake Howard)classnames Wagtail admin template tag (Mehrdad Moradizadeh)admonition should not be used and titles for note are not supported, including clean up of some existing incorrect usage (LB (Ben Johnston)).button-secondary buttons across the admin interface (Paarth Agarwal)button not link for behaviour (LB (Ben) Johnston)search type input in documentation search (LB (Ben) Johnston)help_text when set on FieldPanel, MultiFieldPanel, FieldRowPanel, and other panel APIs where it previously worked without official support (Matt Westcott)openpyxl, removing usage of XlsxWriter, tablib, xlrd and xlwt (Jaap Roes)wagtail.admin.views.generic.IndexView for the Users index listing and search results (Mehrdad Moradizadeh)wagtail.admin.views.generic.CreateView for the User creation view (Mehrdad Moradizadeh)wagtail.admin.views.generic.DeleteView for the User delete view (Mehrdad Moradizadeh)wagtail.admin.views.generic.EditView for the User edit view (Mehrdad Moradizadeh)button-secondary bicolor variants to the pattern library and styleguide (Adinapunyo Banerjee)id primary keys into Wagtail's generic views, including for Snippets and custom User models (Mehrdad Moradizadeh)<section> element so screen reader users can bypass them more easily (Thibaud Colas)update_index command can run without console output if called with --verbosity 0 (Ben Sturmfels, Oliver Parker)image_url template tag, when using the serve view to redirect rather than serve directly, will now use temporary redirects with a cache header instead of permanent redirects (Jake Howard)WagtailPageTestCase - assertPageIsRoutable, assertPageIsRenderable, assertPageIsEditable, assertPageIsPreviewable (Andy Babic)permission to PanelGroup, used by TabbedInterface, ObjectList, FieldRowPanel and MultiFieldPanel (Oliver Parker)PageQuerySet.not_public from returning all pages when no page restrictions exist (Mehrdad Moradizadeh)formfield_callback handling on ModelForm.Meta for future Django 4.2 release (Matt Westcott)ModelAdmin correctly supports filters in combination with subsequent searches without clearing the applied filters (Stefan Hammer)capitalize() calls to avoid issues with other languages or incorrectly presented model names for reporting and parts of site settings (Stefan Hammer)help_text for InlinePanel (Matt Westcott)for_user argument is passed to the form class when previewing pages (Matt Westcott)timesince_simple tag is consistently added in the template based on usage in context (Stefan Hammer)timesince_last_update and ensure the translated labels can be easier to work with in Transifex (Stefan Hammer)clean_name values in the Form Builder validation and increase performance of checks (Dan Bentley)wagtailsearch_editorspick table that prevents flushing the database (Matt Westcott)aria-labels (Matt Westcott)November 1, 2022
---
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).
To help with onboarding new users, Wagtail now displays a banner on the dashboard, pointing users to our Editor Guide. The sidebar also contains a new "Help" menu item with a prominent indicator to call attention to the new content: a "What’s new" page showcasing new features, and a link to the Editor Guide.
Users can dismiss the new banner and the sidebar items’ indicators by interacting with the corresponding UI element. We store the state in the user’s profile so we only call attention to the content once.
To turn off the new banner, set WAGTAIL_ENABLE_WHATS_NEW_BANNER to False in your settings. The new menu items can be removed and customized with the following hooks:
register_help_menu_item – to add new items to the "Help" menuconstruct_help_menu – to change or remove existing items from the "Help" menuconstruct_main_menu – to remove the new "Help" menu altogetherWhen navigating long page editing interfaces, it can be tedious to pinpoint a specific section, or find all validation errors. To help with those tasks, the page editor now has a new "minimap" side panel, with a table of contents of all sections on the form. Clicking a section’s label scrolls straight to this part of the page, and an indicator bar represents which sections are currently visible on the page. When validation errors are present, each section shows a count of the number of errors. This feature was implemented by Thibaud Colas based on a prototype by LB (Ben) Johnston.
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 can set schedules, and when they take effect. This feature was developed by Sage Abdullah.
The register_snippet function now accepts a SnippetViewSet class, allowing various aspects of the snippet's admin views to be customized. See . This feature was developed by Sage Abdullah.
Snippet models that inherit from DraftStateMixin can now be assigned go-live and expiry dates. This feature was developed by Sage Abdullah.
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. By default, references are tracked for all models in the project, including ones not managed through Wagtail - to disable this for specific models, see .
This feature was developed by Karl Hobley and Matt Westcott.
There are multiple improvements to the documentation theme this release, here are some highlights.
PageQuerySet.private method as an alias of not_public (Mehrdad Moradizadeh)AbstractFormField to FormMixin and AbstractEmailForm to EmailFormMixin to allow use with subclasses of Page (Mehrdad Moradizadeh, Kurt Wall)docs.wagtail.org/.well-known/security.txt so that the security policy is available as per the specification on https://securitytxt.org/ (Jake Howard)classnames Wagtail admin template tag (Mehrdad Moradizadeh)admonition should not be used and titles for note are not supported, including clean up of some existing incorrect usage (LB (Ben Johnston)).button-secondary buttons across the admin interface (Paarth Agarwal)button not link for behaviour and remove support for disabled as a class (LB (Ben) Johnston)search type input in documentation search (LB (Ben) Johnston)help_text when set on FieldPanel, MultiFieldPanel, FieldRowPanel, and other panel APIs where it previously worked without official support (Matt Westcott)openpyxl, removing usage of XlsxWriter, tablib, xlrd and xlwt (Jaap Roes)button-secondary bicolor variants to the pattern library and styleguide (Adinapunyo Banerjee)id primary keys into Wagtail's generic views, including for custom Snippets and User models (Mehrdad Moradizadeh)<section> element so screen reader users can bypass them more easily (Thibaud Colas)update_index command can run without console output if called with --verbosity 0 (Ben Sturmfels, Oliver Parker)image_url template tag, when using the serve view to redirect rather than serve directly, will now use temporary redirects with a cache header instead of permanent redirects (Jake Howard)WagtailPageTestCase - assertPageIsRoutable, assertPageIsRenderable, assertPageIsEditable, assertPageIsPreviewable (Andy Babic)permission to PanelGroup, used by TabbedInterface, ObjectList, FieldRowPanel and MultiFieldPanel (Oliver Parker)PageQuerySet.not_public from returning all pages when no page restrictions exist (Mehrdad Moradizadeh)formfield_callback handling on ModelForm.Meta for future Django 4.2 release (Matt Westcott)ModelAdmin correctly supports filters in combination with subsequent searches without clearing the applied filters (Stefan Hammer)capitalize() calls to avoid issues with other languages or incorrectly presented model names for reporting and parts of site settings (Stefan Hammer)help_text for InlinePanel (Matt Westcott)for_user argument is passed to the form class when previewing pages (Matt Westcott)timesince_simple tag is consistently added in the template based on usage in context (Stefan Hammer)timesince_last_update and ensure the translated labels can be easier to work with in Transifex (Stefan Hammer)clean_name values in the Form Builder validation and increase performance of checks (Dan Bentley)wagtailsearch_editorspick table that prevents flushing the database (Matt Westcott)ChooserBlock.extract_references uses the model class, not the model string (Alex Tomkins)aria-labels (Matt Westcott)rebuild_references_index management commandAfter upgrading, you will need to run ./manage.py rebuild_references_index to populate the references table and ensure that usage counts for images, documents and snippets are displayed accurately. By default, references are tracked for all models in the project, including ones not managed through Wagtail - to disable this for specific models, see .
WagtailPageTestCase in place of WagtailPageTestsWagtailPageTestCase is the base testing class and is now recommended over using WagtailPageTests .WagtailPageTests will continue to work and does log in the user on test setUp but may be deprecated in the future.# class MyPageTests(WagtailPageTests): # old
class MyPageTests(WagtailPageTestCase): # new
def setUp(self):
# WagtailPageTestCase will not log in during setUp - so add if needed
super().setUp()
self.login()
def test_can_create_a_page(self):
# ...
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-neutralbutton-strokeonhoverhover-nounbuttonyes.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.New scheduled publishing UI, available from the Status side panel (Sage Abdullah)
SnippetViewSet (Sage Abdullah)DraftStateMixin (Sage Abdullah)PageQuerySet.private method as an alias of not_public (Mehrdad Moradizadeh)unbutton, button-neutral, button-strokeonhover, hover-no, yes) and refactor button styles to be more maintainable (Paarth Agarwal, LB (Ben Johnston))AbstractFormField to FormMixin and AbstractEmailForm to EmailFormMixin to allow use with subclasses of Page (Mehrdad Moradizadeh, Kurt Wall)docs.wagtail.org/.well-known/security.txt so that the security policy is available as per the specification on https://securitytxt.org/ (Jake Howard)classnames Wagtail admin template tag (Mehrdad Moradizadeh)admonition should not be used and titles for note are not supported, including clean up of some existing incorrect usage (LB (Ben Johnston)).button-secondary buttons across the admin interface (Paarth Agarwal)button not link for behaviour (LB (Ben) Johnston)search type input in documentation search (LB (Ben) Johnston)help_text when set on FieldPanel, MultiFieldPanel, FieldRowPanel, and other panel APIs where it previously worked without official support (Matt Westcott)openpyxl, removing usage of XlsxWriter, tablib, xlrd and xlwt (Jaap Roes)wagtail.admin.views.generic.IndexView for the Users index listing and search results (Mehrdad Moradizadeh)wagtail.admin.views.generic.CreateView for the User creation view (Mehrdad Moradizadeh)wagtail.admin.views.generic.DeleteView for the User delete view (Mehrdad Moradizadeh)wagtail.admin.views.generic.EditView for the User edit view (Mehrdad Moradizadeh)button-secondary bicolor variants to the pattern library and styleguide (Adinapunyo Banerjee)id primary keys into Wagtail's generic views, including for Snippets and custom User models (Mehrdad Moradizadeh)<section> element so screen reader users can bypass them more easily (Thibaud Colas)update_index command can run without console output if called with --verbosity 0 (Ben Sturmfels, Oliver Parker)image_url template tag, when using the serve view to redirect rather than serve directly, will now use temporary redirects with a cache header instead of permanent redirects (Jake Howard)WagtailPageTestCase - assertPageIsRoutable, assertPageIsRenderable, assertPageIsEditable, assertPageIsPreviewable (Andy Babic)permission to PanelGroup, used by TabbedInterface, ObjectList, FieldRowPanel and MultiFieldPanel (Oliver Parker)PageQuerySet.not_public from returning all pages when no page restrictions exist (Mehrdad Moradizadeh)formfield_callback handling on ModelForm.Meta for future Django 4.2 release (Matt Westcott)ModelAdmin correctly supports filters in combination with subsequent searches without clearing the applied filters (Stefan Hammer)capitalize() calls to avoid issues with other languages or incorrectly presented model names for reporting and parts of site settings (Stefan Hammer)help_text for InlinePanel (Matt Westcott)for_user argument is passed to the form class when previewing pages (Matt Westcott)timesince_simple tag is consistently added in the template based on usage in context (Stefan Hammer)timesince_last_update and ensure the translated labels can be easier to work with in Transifex (Stefan Hammer)clean_name values in the Form Builder validation and increase performance of checks (Dan Bentley)wagtailsearch_editorspick table that prevents flushing the database (Matt Westcott)Update special-purpose FieldPanel deprecation message to add clarity for developers (Matt Westcott)
(Reissue of 4.0.3 due to packaging issues)
help_text when set on FieldPanel, MultiFieldPanel, FieldRowPanel, and other panel APIs where it previously worked without official support (Matt Westcott)FieldPanel deprecation message to add clarity for developers (Matt Westcott)help_text for InlinePanel (Matt Westcott)AbstractForm & AbstractEmailForm page models correctly pass the form to the preview context (Dan Bentley)October 18, 2022
---
local:
depth: 1
---
help_text when set on FieldPanel, MultiFieldPanel, FieldRowPanel, and other panel APIs where it previously worked without official support (Matt Westcott)FieldPanel deprecation message to add clarity for developers (Matt Westcott)help_text for InlinePanel (Matt Westcott)AbstractForm & AbstractEmailForm page models correctly pass the form to the preview context (Dan Bentley)Update special-purpose FieldPanel deprecation message to add clarity for developers (Matt Westcott)
help_text when set on FieldPanel, MultiFieldPanel, FieldRowPanel, and other panel APIs where it previously worked without official support (Matt Westcott)FieldPanel deprecation message to add clarity for developers (Matt Westcott)help_text for InlinePanel (Matt Westcott)AbstractForm & AbstractEmailForm page models correctly pass the form to the preview context (Dan Bentley)Update all images and sections of the Wagtail Editor's guide to align with the new admin interface changes from Wagtail 3.0 and 4.0 (Thibaud Colas)
DraftStateMixin applied (Sage Abdullah)FilterFieldError (Stefan Hammer)simple_translation app is installed (Dan Braghis)MultiFieldPanel correctly outputs all child classnames in the template (Matt Westcott)September 23, 2022
---
local:
depth: 1
---
DraftStateMixin applied (Sage Abdullah)FilterFieldError (Stefan Hammer)simple_translation app is installed (Dan Braghis)MultiFieldPanel correctly outputs all child classnames in the template (Matt Westcott)Fix: On the Locked Pages report, limit the "locked by" filter to just users who have locked pages (Stefan Hammer)
September 5, 2022
---
local:
depth: 1
---
Deprecate the usage and documentation of the wagtail.contrib.modeladmin.menus.SubMenu class, provide a warning if used directing developers to use wag…
BaseGenericSetting base model class that allows defining a settings model that applies to all sites rather than just a single site (Kyle Bayliss)base_url_path to ModelAdmin so that the default URL structure of app_label/model_name can be overridden (Vu Pham, Khanh Hoang)full_url to the API output of ImageRenditionField (Paarth Agarwal)InlinePanel's label when available for field comparison label (Sandil Ranasinghe)FormData instead of jQuery's form.serialize when editing documents or images just added so that additional fields can be better supported (Stefan Hammer)PageRevision with generic Revision model (Sage Abdullah)wagtail.admin.views.generic (Matt Westcott)wagtail.admin.widgets.chooser.BaseChooser to make it easier to build custom chooser inputs (Matt Westcott)WAGTAIL_ENABLE_UPDATE_CHECK = 'lts' (Tibor Leupold)prefetch_renditions method to ImageQueryset for performance optimisation on image listings (Tidiane Dia, Karl Hobley)get_field_clean_name method when defining FormField models that extend AbstractFormField (LB (Ben) Johnston)core.css file (Thibaud Colas)ReportView to extend from generic wagtail.admin.views.generic.models.IndexView (Sage Abdullah)wagtail.admin.viewsets.chooser.ChooserViewSet module to serve as a common base implementation for chooser modals (Matt Westcott)wagtail.admin.viewsets.model.ModelViewSet (Matt Westcott)add_to_admin_menu option for ModelAdmin (Oliver Parker)Page.get_latest_revision_as_page to Page.get_latest_revision_as_object (Sage Abdullah)PermissionHelper (Tidiane Dia)get_snippet_edit_handler function to wagtail.admin.panels.get_edit_handler (Sage Abdullah)boost works when using Postgres with the database search backend (Tibor Leupold)explorer_breadcrumb template tag to breadcrumbs as it is now used in multiple locations (Paarth Agarwal)django-filter version to support 23 (Yuekui).iterator() in a few more places in the admin, to make it more stable on sites with many pages (Andy Babic)wagtail.contrib.modeladmin.menus.SubMenu class, provide a warning if used directing developers to use wagtail.admin.menu.Menu instead (Matt Westcott)ModelAdmin usage of breadcrumbs completely (Paarth Agarwal)WAGTAILADMIN_USER_PASSWORD_RESET_FORM setting for overriding the admin password reset form (Michael Karamuth)classnames template tag to easily build up classes from variables provided to a template (Paarth Agarwal)ModelAdmin InspectView footer actions consistent with other parts of the UI (Thibaud Colas)menu_item_name to modify MenuItem's name for ModelAdmin (Alexander Rogovskyy, Vu Pham)blocks_by_name and first_block_by_name methods on StreamValue (Tidiane Dia, Matt Westcott)SearchableListMixin (Sage Abdullah)is_parent kwarg in various page button hooks as this approach is no longer required (Paarth Agarwal)BadSignature error (Jaap Roes)range utility function (LB (Ben) Johnston)main id on main element (for skip link) and consistent DOM layout for h1 header (Paarth Agarwal, LB (Ben) Johnston)autofocus (LB (Ben) Johnston)path and re_path decorators to the RoutablePageMixin module which emulate their Django URL utils equivalent, redirect re_path to the original route decorator (Tidiane Dia)BaseChooser widget now provides a Telepath adapter that's directly usable for any subclasses that use the chooser widget and modal JS as-is with no customisations (Matt Westcott)ResumeWorkflowActionFormatter message (Stefan Hammer)ModelAdmin index listings with export list enabled would show buttons with an incorrect layout (Josh Woodcock)aria-label is not set on locale selection dropdown within page chooser modal as it was a duplicate of the button contents (LB (Ben Johnston))ModelAdmin title column behaviour to only link to 'edit' if the user has the correct permissions, fallback to the 'inspect' view or a non-clickable title if needed (Stefan Hammer)DecimalBlock preserves the Decimal type when retrieving from the database (Yves Serrano)ngettext in Wagtail's internal JavaScript internationalisation utilities now works (LB (Ben) Johnston)ModelAdmin single selection lists show correctly with Django 4.0 form template changes (Coen van der Kamp)AttributeError when an empty search param q= is combined with other filters in the Images index view (Paritosh Kabra)extra_actions in new changes to shared header template to avoid invalid template variable usage (Paarth Agarwal)BaseSiteSetting / BaseGenericSetting objects can be pickled (Andy Babic)DocumentChooserBlock can be deconstructed for migrations (Matt Westcott)BaseSetting when upgrading to Wagtail 4.0 (Stefan Hammer)updatemodulepaths command for Python 3.7 (Matt Westcott)August 31, 2022
---
local:
depth: 1
---
This release adds support for Django 4.1. When upgrading, please note that the django-taggit library also needs to be updated to 3.0.0 or above.
The new BaseGenericSetting base model class allows defining a settings model that applies to all sites rather than just a single site.
See the Settings documentation for more information. This feature was implemented by Kyle Bayliss.
When using a queryset to render a list of images, you can now use the prefetch_renditions() queryset method to prefetch the renditions needed for rendering with a single extra query, similar to prefetch_related. If you have many renditions per image, you can also call it with filters as arguments - prefetch_renditions("fill-700x586", "min-600x400") - to fetch only the renditions you intend on using for a smaller query. For long lists of images, this can provide a significant boost to performance. See for more examples. This feature was developed by Tidiane Dia and Karl Hobley.
Following from Wagtail 3.0, this release contains significant UI changes that affect all of Wagtail's admin, largely driven by the implementation of the new Page Editor. These include:
Further updates to the page editor are expected in the next release. Those changes were implemented by Thibaud Colas. Development on this feature was sponsored by Google.
(rich_text_improvements_4)=
As part of the page editor redesign project sponsored by Google, we have made several improvements to our rich text editor:
1. to a list item. It’s now possible to un-do this change and keep the text as-is. This works for all Markdown-style shortcuts.Wagtail’s page preview is now available in a side panel within the page editor. This preview auto-updates as users type, and can display the page in three different viewports: mobile, tablet, desktop. The existing preview functionality is still present, moved inside the preview panel rather than at the bottom of the page editor. The auto-update delay can be configured with the WAGTAIL_AUTO_UPDATE_PREVIEW_INTERVAL setting. This feature was developed by Sage Abdullah.
In Wagtail 2.12, we introduced theming support for Wagtail’s primary brand color. This has now been extended to almost all of Wagtail’s color palette. View our documentation for more information, an overview of Wagtail’s customizable color palette, and a live demo of the supported customizations. This was implemented by Thibaud Colas, under the page editor redesign project sponsored by Google.
In Wagtail 2.16, we introduced support for Windows High Contrast mode (WHCM). This release sees a lot of improvements to our support, thanks to our new contributor Anuja Verma, who has been working on this as part of the Contrast Themes Google Summer of Code project, with support from Jane Hughes, Scott Cranfill, and Thibaud Colas.
In Wagtail 3.0, a new Page Editor experience was introduced, this release brings many of the UX and UI improvements to other parts of Wagtail for a more consistent experience. The bulk of these enhancements have been from Paarth Agarwal, who has been doing the UX Unification internship project alongside other Google Summer of Code participants. This internship has been sponsored by Torchbox with mentoring support from LB (Ben Johnston), Thibaud Colas and Helen Chapman.
autofocusexplorer_breadcrumb template tag to breadcrumbs as it is now used in multiple locationsModelAdmin usage of breadcrumbs completely and adopt consistent 'back' link approachSnippets can now be given a previewable HTML representation, revision history, and draft / live states through the use of the mixins PreviewableMixin, RevisionMixin, and DraftStateMixin. For more details, see:
These features were developed by Sage Abdullah.
The documentation now has dark mode which will be turned on by default if set in your browser or OS preferences, it can also be toggled on and off manually. The colors and fonts of the documentation now align with the design updates introduced in Wagtail 3.0. These features were developed by Vince Salvino.
There are also many improvements to the documentation both under the hood and in the layout;
base_url_path to ModelAdmin so that the default URL structure of app_label/model_name can be overridden (Vu Pham, Khanh Hoang)full_url to the API output of ImageRenditionField (Paarth Agarwal)InlinePanel's label when available for field comparison label (Sandil Ranasinghe)FormData instead of jQuery's form.serialize when editing documents or images just added so that additional fields can be better supported (Stefan Hammer)wagtail.admin.views.generic (Matt Westcott)wagtail.admin.widgets.chooser.BaseChooser to make it easier to build custom chooser inputs (Matt Westcott)WAGTAIL_ENABLE_UPDATE_CHECK = 'lts' (Tibor Leupold)prefetch_renditions method to ImageQueryset for performance optimization on image listings (Tidiane Dia, Karl Hobley)get_field_clean_name method when defining FormField models that extend AbstractFormField (LB (Ben) Johnston)core.css file (Thibaud Colas)ReportView to extend from generic wagtail.admin.views.generic.models.IndexView (Sage Abdullah)Unpublish view to extend from generic wagtail.admin.views.generic.models.UnpublishView (Sage Abdullah)wagtail.admin.viewsets.chooser.ChooserViewSet module to serve as a common base implementation for chooser modals (Matt Westcott)wagtail.admin.viewsets.model.ModelViewSet (Matt Westcott)add_to_admin_menu option for ModelAdmin (Oliver Parker)PermissionHelper (Tidiane Dia)boost works when using Postgres with the database search backend (Tibor Leupold)django-filter version to support 22 (Yuekui).iterator() in a few more places in the admin, to make it more stable on sites with many pages (Andy Babic)wagtail.contrib.modeladmin.menus.SubMenu class, provide a warning if used directing developers to use wagtail.admin.menu.Menu instead (Matt Westcott)WAGTAILADMIN_USER_PASSWORD_RESET_FORM setting for overriding the admin password reset form (Michael Karamuth)classnames template tag to easily build up classes from variables provided to a template (Paarth Agarwal)ModelAdmin InspectView footer actions consistent with other parts of the UI (Thibaud Colas)menu_item_name to modify MenuItem's name for ModelAdmin (Alexander Rogovskyy, Vu Pham)blocks_by_name and first_block_by_name methods on StreamValue (Tidiane Dia, Matt Westcott)is_parent kwarg in various page button hooks as this approach is no longer required (Paarth Agarwal)BadSignature error (Jaap Roes)path and re_path decorators to the RoutablePageMixin module which emulate their Django URL utils equivalent, redirect re_path to the original route decorator (Tidiane Dia)BaseChooser widget now provides a Telepath adapter that's directly usable for any subclasses that use the chooser widget and modal JS as-is with no customizations (Matt Westcott)ModelAdmin index listings with export list enabled would show buttons with an incorrect layout (Josh Woodcock)ResumeWorkflowActionFormatter message (Stefan Hammer)PageRevision with generic Revision model (Sage Abdullah)aria-label is not set on locale selection dropdown within page chooser modal as it was a duplicate of the button contents (LB (Ben Johnston))ModelAdmin title column behavior to only link to 'edit' if the user has the correct permissions, fallback to the 'inspect' view or a non-clickable title if needed (Stefan Hammer)DecimalBlock preserves the Decimal type when retrieving from the database (Yves Serrano)ngettext in Wagtail's internal JavaScript internationalisation utilities now works (LB (Ben) Johnston)ModelAdmin single selection lists show correctly with Django 4.0 form template changes (Coen van der Kamp)AttributeError when an empty search param q= is combined with other filters in the Images index view (Paritosh Kabra)BaseSiteSetting / BaseGenericSetting objects can be pickled (Andy Babic)DocumentChooserBlock can be deconstructed for migrations (Matt Westcott)BaseSetting when upgrading to Wagtail 4.0 (Stefan Hammer)updatemodulepaths command for Python 3.7 (Matt Westcott)Page.serve() and Page.serve_preview() methodsAs part of making previews available to non-page models, the serve_preview() method has been decoupled from the serve() method and extracted into the PreviewableMixin class. If you have overridden the serve() method in your page models, you will likely need to override serve_preview(), get_preview_template(), and/or get_preview_context() methods to handle previews accordingly. Alternatively, you can also override the preview_modes property to return an empty list to disable previews.
The live preview panel utilizes an iframe to display the preview in the editor page, which requires the page in the iframe to have the X-Frame-Options header set to SAMEORIGIN (or unset). If you click a link within the preview panel, you may notice that the iframe stops working. This is because the link is loaded within the iframe and the linked page may have the X-Frame-Options header set to DENY. To work around this problem, add the following <base> tag within your <head> element in your base.html template, before any <link> elements:
{% if request.in_preview_panel %}
<base target="_blank">
{% endif %}
This will make all links in the live preview panel open in a new tab.
As of Wagtail 4.0.1, new Wagtail projects created through the wagtail start command already include this change in the base template.
base_url_path keyword argument added to AdminURLHelperThe wagtail.contrib.modeladmin.helpers.AdminURLHelper class now accepts a base_url_path keyword argument on its constructor. Custom subclasses of this class should be updated to accept this keyword argument.
Safari 13 will no longer be officially supported as of this release, this deviates the current support for the last 3 version of Safari by a few months and was required to add better support for RTL languages.
PageRevision replaced with RevisionThe PageRevision model has been replaced with a generic Revision model. If you use the PageRevision model in your code, make sure that:
PageRevision objects should be updated to create Revision objects using the page's id as the object_id, the default Page model's content type as the base_content_type, and the page's specific content type as the content_type.PageRevision.objects manager should be updated to use the Revision.page_revisions manager.Revision queries that use Page.id should be updated to cast the Page.id to a string before using it in the query (e.g. by using str() or Cast("page_id", output_field=CharField())).Page queries that use PageRevision.page_id should be updated to cast the Revision.object_id to an integer before using it in the query (e.g. by using int() or Cast("object_id", output_field=IntegerField())).PageRevision.page should be updated to Revision.content_object.If you maintain a package across multiple Wagtail versions that includes a model with a ForeignKey to the PageRevision model, you can create a helper function to correctly resolve the model depending on the installed Wagtail version, for example:
from django.db import models
from wagtail import VERSION as WAGTAIL_VERSION
def get_revision_model():
if WAGTAIL_VERSION >= (4, 0):
return "wagtailcore.Revision"
return "wagtailcore.PageRevision"
class MyModel(models.Model):
# Before
# revision = models.ForeignKey("wagtailcore.PageRevision")
revision = models.ForeignKey(get_revision_model(), on_delete=models.CASCADE)
Page.get_latest_revision_as_page renamed to Page.get_latest_revision_as_objectThe Page.get_latest_revision_as_page method has been renamed to Page.get_latest_revision_as_object. The old name still exists for backwards-compatibility, but calling it will raise a RemovedInWagtail50Warning.
AdminChooser replaced with BaseChooserCustom choosers should no longer use wagtail.admin.widgets.chooser.AdminChooser which has been replaced with wagtail.admin.widgets.chooser.BaseChooser.
get_snippet_edit_handler moved to wagtail.admin.panels.get_edit_handlerThe get_snippet_edit_handler function in wagtail.snippets.views.snippets has been moved to get_edit_handler in wagtail.admin.panels.
explorer_breadcrumb template tag has been renamed to breadcrumbs, move_breadcrumb has been removedThe explorer_breadcrumb template tag is not documented, however if used it will need to be renamed to breadcrumbs and the url_name is now a required arg.
The move_breadcrumb template tag is no longer used and has been removed.
wagtail.contrib.modeladmin.menus.SubMenu is deprecatedThe wagtail.contrib.modeladmin.menus.SubMenu class should no longer be used for constructing submenus of the admin sidebar menu. Instead, import wagtail.admin.menu.Menu and pass the list of menu items as the items keyword argument.
The internal JavaScript functions createPageChooser, createSnippetChooser, createDocumentChooser and createImageChooser used for initializing chooser widgets have been replaced by classes, and user code that calls them needs to be updated accordingly:
createPageChooser(id) should be replaced with new PageChooser(id)createSnippetChooser(id) should be replaced with new SnippetChooser(id)createDocumentChooser(id) should be replaced with new DocumentChooser(id)createImageChooser(id) should be replaced with new ImageChooser(id)If your code contains references to URL route names within the wagtailimages, wagtaildocs or wagtailsnippets namespaces, these should be updated as follows:
wagtailimages:chooser is now wagtailimages_chooser:choosewagtailimages:chooser_results is now wagtailimages_chooser:choose_resultswagtailimages:image_chosen is now wagtailimages_chooser:chosenwagtailimages:chooser_upload is now wagtailimages_chooser:createwagtailimages:chooser_select_format is now wagtailimages_chooser:select_formatwagtaildocs:chooser is now wagtaildocs_chooser:choosewagtaildocs:chooser_results is now wagtaildocs_chooser:choose_resultswagtaildocs:document_chosen is now wagtaildocs_chooser:chosenwagtaildocs:chooser_upload is now wagtaildocs_chooser:createwagtailsnippets:list, wagtailsnippets:list_results, wagtailsnippets:add, wagtailsnippets:edit, wagtailsnippets:delete-multiple, wagtailsnippets:delete, wagtailsnippets:usage, wagtailsnippets:history: These now exist in a separate wagtailsnippets_{app_label}_{model_name} namespace for each snippet model, and no longer take app_label and model_name as arguments.wagtailsnippets:choose, wagtailsnippets:choose_results, wagtailsnippets:chosen: These now exist in a separate wagtailsnippetchoosers_{app_label}_{model_name} namespace for each snippet model, and no longer take app_label and model_name as arguments.As part of the introduction of the new live preview panel, we have changed the WAGTAIL_AUTO_UPDATE_PREVIEW setting to be on (True) by default. This can still be turned off by setting it to False. The WAGTAIL_AUTO_UPDATE_PREVIEW_INTERVAL setting has been introduced for sites willing to reduce the performance cost of the live preview without turning it off completely.
The page explorer listings now use Wagtail’s new slim header, replacing the previous large teal header. The parent page’s metadata and related actions are now available within the “Info” side panel, while the majority of buttons are now available under the Actions dropdown in the header, identically to the page create/edit forms.
Customizing which actions are available and adding extra actions is still possible, but has to be done with the register_page_header_buttons hook, rather than register_page_listing_buttons and register_page_listing_more_buttons. Those hooks still work as-is to define actions for each page within the listings.
is_parent removed from page button hooksconstruct_page_listing_buttons, register_page_listing_buttons, register_page_listing_more_buttons no longer accept the is_parent keyword argument and this should be removed.is_parent was the previous approach for determining whether the buttons would show in the listing rows or the page's more button, this can be now achieved with discrete hooks instead.As part of our support for theming across all colors, we’ve had to rename or remove some of the pre-existing CSS variables. Wagtail’s indigo is now customizable with --w-color-primary, and the teal is customizable as --w-color-secondary. See for an overview of all customizable colors. Here are replaced variables:
--color-primary is now --w-color-secondary--color-primary-hue is now --w-color-secondary-hue--color-primary-saturation is now --w-color-secondary-saturation--color-primary-lightness is now --w-color-secondary-lightness--color-primary-darker is now --w-color-secondary-400--color-primary-darker-hue is now --w-color-secondary-400-hue--color-primary-darker-saturation is now --w-color-secondary-400-saturation--color-primary-darker-lightness is now --w-color-secondary-400-lightness--color-primary-dark is now --w-color-secondary-600--color-primary-dark-hue is now --w-color-secondary-600-hue--color-primary-dark-saturation is now --w-color-secondary-600-saturation--color-primary-dark-lightness is now --w-color-secondary-600-lightness--color-primary-lighter is now --w-color-secondary-100--color-primary-lighter-hue is now --w-color-secondary-100-hue--color-primary-lighter-saturation is now --w-color-secondary-100-saturation--color-primary-lighter-lightness is now --w-color-secondary-100-lightness--color-primary-light is now --w-color-secondary-50--color-primary-light-hue is now --w-color-secondary-50-hue--color-primary-light-saturation is now --w-color-secondary-50-saturation--color-primary-light-lightness is now --w-color-secondary-50-lightnessWe’ve additionally removed all --color-input-focus and --color-input-focus-border variables, as Wagtail’s form fields no longer have a different color on focus.
WAGTAILDOCS_DOCUMENT_FORM_BASE and WAGTAILIMAGES_IMAGE_FORM_BASE must inherit from BaseDocumentForm / BaseImageFormPreviously, it was valid to specify an arbitrary model form as the WAGTAILDOCS_DOCUMENT_FORM_BASE / WAGTAILIMAGES_IMAGE_FORM_BASE settings. This is no longer supported; these forms must now inherit from wagtail.documents.forms.BaseDocumentForm and wagtail.images.forms.BaseImageForm respectively.
As part of the page editor redesign, we have removed support for the classname="full" customization to panels. Existing title and collapsed customizations remain unchanged.
route decorator for RoutablePageMixinroute decorator at this time.RoutablePageMixin contrib module now provides a path decorator that behaves the same way as Django's {func}django.urls.path function.RoutablePageMixin's route decorator will now redirect to a new re_path decorator that emulates the behavior of {func}django.urls.re_path.BaseSetting model replaced by BaseSiteSettingThe wagtail.contrib.settings.models.BaseSetting model has been replaced by two new base models BaseSiteSetting and BaseGenericSetting, to accommodate settings that are shared across all sites. Existing setting models that inherit BaseSetting should be updated to use BaseSiteSetting instead:
from wagtail.contrib.settings.models import BaseSetting, register_setting
@register_setting
class SiteSpecificSocialMediaSettings(BaseSetting):
facebook = models.URLField()
should become
from wagtail.contrib.settings.models import BaseSiteSetting, register_setting
@register_setting
class SiteSpecificSocialMediaSettings(BaseSiteSetting):
facebook = models.URLField()
Add missing icon file causing manage.py collectstatic to fail
Changes from 4.0rc1:
manage.py collectstatic to failget_preview_template and get_preview_context methodsDeprecate the usage and documentation of the wagtail.contrib.modeladmin.menus.SubMenu class, provide a warning if used directing developers to use wag…
BaseGenericSetting base model class that allows defining a settings model that applies to all sites rather than just a single site (Kyle Bayliss)base_url_path to ModelAdmin so that the default URL structure of app_label/model_name can be overridden (Vu Pham, Khanh Hoang)full_url to the API output of ImageRenditionField (Paarth Agarwal)ModelAdmin index listings with export list enabled would show buttons with an incorrect layout (Josh Woodcock)InlinePanel's label when available for field comparison label (Sandil Ranasinghe)FormData instead of jQuery's form.serialize when editing documents or images just added so that additional fields can be better supported (Stefan Hammer)PageRevision with generic Revision model (Sage Abdullah)wagtail.admin.views.generic (Matt Westcott)wagtail.admin.widgets.chooser.BaseChooser to make it easier to build custom chooser inputs (Matt Westcott)WAGTAIL_ENABLE_UPDATE_CHECK = 'lts' (Tibor Leupold)prefetch_renditions method to ImageQueryset for performance optimisation on image listings (Tidiane Dia, Karl Hobley)get_field_clean_name method when defining FormField models that extend AbstractFormField (LB (Ben) Johnston)core.css file (Thibaud Colas)ReportView to extend from generic wagtail.admin.views.generic.models.IndexView (Sage Abdullah)wagtail.admin.viewsets.chooser.ChooserViewSet module to serve as a common base implementation for chooser modals (Matt Westcott)wagtail.admin.viewsets.model.ModelViewSet (Matt Westcott)add_to_admin_menu option for ModelAdmin (Oliver Parker)Page.get_latest_revision_as_page to Page.get_latest_revision_as_object (Sage Abdullah)get_snippet_edit_handler function to wagtail.admin.panels.get_edit_handler (Sage Abdullah)boost works when using Postgres with the database search backend (Tibor Leupold)explorer_breadcrumb template tag to breadcrumbs as it is now used in multiple locations (Paarth Agarwal)django-filter version to support 23 (Yuekui).iterator() in a few more places in the admin, to make it more stable on sites with many pages (Andy Babic)wagtail.contrib.modeladmin.menus.SubMenu class, provide a warning if used directing developers to use wagtail.admin.menu.Menu instead (Matt Westcott)ModelAdmin usage of breadcrumbs completely (Paarth Agarwal)WAGTAILADMIN_USER_PASSWORD_RESET_FORM setting for overriding the admin password reset form (Michael Karamuth)classnames template tag to easily build up classes from variables provided to a template (Paarth Agarwal)menu_item_name to modify MenuItem's name for ModelAdmin (Alexander Rogovskyy, Vu Pham)blocks_by_name and first_block_by_name methods on StreamValue (Tidiane Dia, Matt Westcott)SearchableListMixin (Sage Abdullah)is_parent kwarg in various page button hooks as this approach is no longer required (Paarth Agarwal)BadSignature error (Jaap Roes)range util for (LB (Ben) Johnston)main id on main element (for skip link) and consistent DOM layout for h1 header (Paarth Agarwal, LB (Ben) Johnston)autofocus (LB (Ben) Johnston)path and re_path decorators to the RoutablePageMixin module which emulate their Django URL utils equivalent, redirect re_path to the original route decorator (Tidiane Dia)BaseChooser widget now provides a Telepath adapter that's directly usable for any subclasses that use the chooser widget and modal JS as-is with no customisations (Matt Westcott)ResumeWorkflowActionFormatter message (Stefan Hammer)aria-label is not set on locale selection dropdown within page chooser modal as it was a duplicate of the button contents (LB (Ben Johnston))ModelAdmin title column behaviour to only link to 'edit' if the user has the correct permissions, fallback to the 'inspect' view or a non-clickable title if needed (Stefan Hammer)DecimalBlock preserves the Decimal type when retrieving from the database (Yves Serrano)ngettext in Wagtail's internal JavaScript internationalisation utilities now works (LB (Ben) Johnston)AttributeError when an empty search param q= is combined with other filters in the Images index view (Paritosh Kabra)extra_actions in new changes to shared header template to avoid invalid template variable usage (Paarth Agarwal)BaseSiteSetting / BaseGenericSetting objects can be pickled (Andy Babic)Fix: On the Locked Pages report, limit the "locked by" filter to just users who have locked pages (Stefan Hammer)
September 5, 2022
---
local:
depth: 1
---
Fix: Ensure string representation of FormSubmission returns a string (LB (Ben Johnston))
FormSubmission returns a string (LB (Ben Johnston))updatemodulepaths command for Python 3.7 (Matt Westcott)August 30, 2022
---
local:
depth: 1
---
FormSubmission returns a string (LB (Ben Johnston))updatemodulepaths command for Python 3.7 (Matt Westcott)Add warning when WAGTAILADMIN_BASE_URL is not configured (Matt Westcott)
WAGTAILADMIN_BASE_URL is not configured (Matt Westcott)TabbedInterface will not show a tab if no panels are visible due to permissions (Paarth Agarwal)WAGTAIL_ENABLE_UPDATE_CHECK sends the referrer origin with strict-origin-when-cross-origin (Karl Hobley)WAGTAILADMIN_BASE_URL is absent due to the request object not being available (Matt Westcott)June 16, 2022
---
local:
depth: 1
---
WAGTAILADMIN_BASE_URL is not configured (Matt Westcott)TabbedInterface will not show a tab if no panels are visible due to permissions (Paarth Agarwal)WAGTAIL_ENABLE_UPDATE_CHECK sends the referrer origin with strict-origin-when-cross-origin (Karl Hobley)WAGTAILADMIN_BASE_URL is absent due to the request object not being available (Matt Westcott)Phase out special-purpose panel types (StreamFieldPanel, RichTextFieldPanel, ImageChooserPanel, DocumentChooserPanel, PageChooserPanel, SnippetChooser
StreamFieldPanel, RichTextFieldPanel, ImageChooserPanel, DocumentChooserPanel, PageChooserPanel, SnippetChooserPanel) in favour of FieldPanel (Matt Westcott):focus-visible for cross-browser consistency (Paarth Agarwal)modelAdmin (Serafeim Papastefanos)README.md logo to work for GitHub dark mode (Paarth Agarwal)If-Modified-Since header in sendfile_streaming_backend which was only used by IE (Mariusz Felisiak)StreamField to use JSONField to store data, rather than TextField (Sage Abdullah)content_json TextField with content JSONField in PageRevision (Sage Abdullah)replace_text management command (Sage Abdullah)data_json TextField with data JSONField in BaseLogEntry (Sage Abdullah)page_description to the Page model, to provide help text for a given page type (Kalob Taulien, Thibaud Colas, Matt Westcott, Stefan Hammer)trimmed attribute to all blocktrans tags, so spacing is more reliable in translated strings (Harris Lapiroff)ModelAdmin to manage Tags (Abdulmajeed Isa)BASE_URL (undocumented) to WAGTAILADMIN_BASE_URL and add to documentation, BASE_URL will be removed in a future release (Sandil Ranasinghe)AbstractEmailForm (Jake Howard)WAGTAILIMAGES_RENDITION_STORAGE setting to allow an alternative image rendition storage (Heather White)wagtail_update_image_renditions management command to regenerate image renditions or purge all existing renditions (Hitansh Shah, Onno Timmerman, Damian Moore)PageQuerySet.specific() to reduce memory consumption (Andy Babic)TAG_SPACES_ALLOWED is True or False (Abdulmajeed Isa)AbstractFormSubmission's form_data to use JSONField to store form submissions (Jake Howard)simple_translations ensure that the user is redirected to the page edit view when submitting for a single locale (Mitchel Cabuloy)Form pages, ensure that all added fields are correctly shown in the preview (Joshua Munn)WAGTAILDOCS_CONTENT_TYPES & WAGTAILDOCS_INLINE_CONTENT_TYPES ensure that the filename is correctly set in the Content-Disposition header so that saving the files will use the correct filename (John-Scott Atlakson)aria-haspopup="menu" for all sidebar menu items that have sub-menus (LB (Ben Johnston))aria-expanded is always explicitly set as a string in sidebar (LB (Ben Johnston))role="main" attributes on <main> elements causing HTML validation issues (Luis Espinoza)lang attributes to <html> elements (James Ray)thumb_col_header_text is correctly used by ThumbnailMixin within ModelAdmin as the column header label (Kyle J. Roux)exclude_fields_in_copy (John-Scott Atlakson)IntegrityError when publishing pages with translatable Orderables that were copied without being published (Kalob Taulien, Dan Braghis)GenericRelation when copying pages (John-Scott Atlakson)wagtail updatemodulepaths works when system locale is not UTF-8 (Matt Westcott)STATIC_URL is not "/static/" (Jacob Topp-Mugglestone)May 16, 2022
---
local:
depth: 1
---
This release contains significant UI changes that affect all of Wagtail's admin, largely driven by the implementation of the new Page Editor. These include:
Other changes that are specific to the Page Editor include:
Further updates to the page editor are expected in the next release. Development on this feature was sponsored by Google.
Rich text blocks within StreamField now provide the ability to split a block at the cursor position, allowing new blocks to be inserted in between. This feature was developed by Jacob Topp-Mugglestone and sponsored by The Motley Fool.
The panel types StreamFieldPanel, RichTextFieldPanel, ImageChooserPanel, DocumentChooserPanel and SnippetChooserPanel have been phased out, and can now be replaced with FieldPanel. Additionally, PageChooserPanel is only required when passing a page_type or can_choose_root, and can otherwise be replaced with FieldPanel. In all cases, FieldPanel will now automatically select the most appropriate form element. This feature was developed by Matt Westcott.
FieldPanel now accepts a permission keyword argument to specify that the field should only be available to users with a given permission level. This feature was developed by Matt Westcott and sponsored by Google as part of Wagtail's page editor redevelopment.
With every Wagtail Page you are able to add a helpful description text, similar to a help_text model attribute. By adding page_description to your Page model you'll be adding a short description that can be seen in different places within Wagtail:
class LandingPage(Page):
page_description = "Use this page for converting users"
Trying to upload an image that's a duplicate of one already in the image library will now lead to a confirmation step. This feature was developed by Tidiane Dia and sponsored by The Motley Fool.
When using a queryset to render a list of items with images, you can now make use of Django's built-in prefetch_related() queryset method to prefetch the renditions needed for rendering with a single extra query. For long lists of items, or where multiple renditions are used for each item, this can provide a significant boost to performance. This feature was developed by Andy Babic.
content_json TextField with content JSONField in PageRevision (Sage Abdullah)replace_text management command (Sage Abdullah)data_json TextField with data JSONField in BaseLogEntry (Sage Abdullah):focus-visible for cross-browser consistency (Paarth Agarwal)ModelAdmin (Serafeim Papastefanos)README.md logo to work for GitHub dark mode (Paarth Agarwal)If-Modified-Since header in sendfile_streaming_backend which was only used by IE (Mariusz Felisiak)StreamField to use JSONField to store data, rather than TextField (Sage Abdullah)trimmed attribute to all blocktrans tags, so spacing is more reliable in translated strings (Harris Lapiroff)ModelAdmin to manage Tags (Abdulmajeed Isa)BASE_URL (undocumented) to WAGTAILADMIN_BASE_URL and add to documentation, BASE_URL will be removed in a future release (Sandil Ranasinghe)AbstractEmailForm (Jake Howard)WAGTAILIMAGES_RENDITION_STORAGE setting to allow an alternative image rendition storage (Heather White)wagtail_update_image_renditions management command to regenerate image renditions or purge all existing renditions (Hitansh Shah, Onno Timmerman, Damian Moore)PageQuerySet.specific() to reduce memory consumption (Andy Babic)TAG_SPACES_ALLOWED is True or False (Abdulmajeed Isa)AbstractFormSubmission's form_data to use JSONField to store form submissions (Jake Howard)simple_translations ensure that the user is redirected to the page edit view when submitting for a single locale (Mitchel Cabuloy)Form pages, ensure that all added fields are correctly shown in the preview (Joshua Munn)WAGTAILDOCS_CONTENT_TYPES & WAGTAILDOCS_INLINE_CONTENT_TYPES ensure that the filename is correctly set in the Content-Disposition header so that saving the files will use the correct filename (John-Scott Atlakson)aria-haspopup="menu" for all sidebar menu items that have sub-menus (LB (Ben Johnston))aria-expanded is always explicitly set as a string in sidebar (LB (Ben Johnston))role="main" attributes on <main> elements causing HTML validation issues (Luis Espinoza)lang attributes to <html> elements (James Ray)thumb_col_header_text is correctly used by ThumbnailMixin within ModelAdmin as the column header label (Kyle J. Roux)exclude_fields_in_copy (John-Scott Atlakson)Orderables when page is copied without being published (Kalob Taulien, Dan Braghis)GenericRelation when copying pages (John-Scott Atlakson)wagtail updatemodulepaths works when system locale is not UTF-8 (Matt Westcott)STATIC_URL is not "/static/" (Jacob Topp-Mugglestone)Various modules of Wagtail have been reorganized, and imports should be updated as follows:
wagtail.core.utils module is renamed to wagtail.coreutilswagtail.core can now be found under wagtail - for example, from wagtail.core.models import Page should be changed to from wagtail.models import Pagewagtail.tests module is renamed to wagtail.testwagtail.admin.edit_handlers is renamed to wagtail.admin.panelswagtail.contrib.forms.edit_handlers is renamed to wagtail.contrib.forms.panelsThese changes can be applied automatically to your project codebase by running the following commands from the project root:
wagtail updatemodulepaths --list # list the files to be changed without updating them
wagtail updatemodulepaths --diff # show the changes to be made, without updating files
wagtail updatemodulepaths # actually update the files
Within panel definitions on models, StreamFieldPanel, RichTextFieldPanel, ImageChooserPanel, DocumentChooserPanel and SnippetChooserPanel should now be replaced with FieldPanel. Additionally, PageChooserPanel can be replaced with FieldPanel if it does not use the page_type or can_choose_root arguments.
BASE_URL setting renamed to WAGTAILADMIN_BASE_URLReferences to BASE_URL in your settings should be updated to WAGTAILADMIN_BASE_URL. This setting was not previously documented, but was part of the default project template when starting a project with the wagtail start command, and specifies the full base URL for the Wagtail admin, for use primarily in email notifications.
use_json_field argument added to StreamFieldAll uses of StreamField should be updated to include the argument use_json_field=True. After adding this, make sure to generate and run migrations. This converts the field to use JSONField as its internal type instead of TextField, which will allow you to use JSONField lookups and transforms on the field. This change is necessary to ensure that the database migration is applied; a future release will drop support for TextField-based StreamFields.
JSON1 extension enabledDue to {class}~django.db.models.JSONField requirements, SQLite will only be supported with the JSON1 extension enabled.
See Enabling JSON1 extension on SQLite and JSON1 extension for details.
IE11 support was officially dropped in Wagtail 2.15, and as of this release there will no longer be a warning shown to users of this browser. Wagtail is fully compatible with Microsoft Edge, Microsoft’s replacement for Internet Explorer. You may consider using its IE mode to keep access to IE11-only sites, while other sites and apps like Wagtail can leverage modern browser capabilities.
Hallo was deprecated in Wagtail v2.0 (February 2018) and has had only a minimal level of support since then. If you still require Hallo for your Wagtail installation, you will need to install the Wagtail Hallo editor legacy package. We encourage all users of the Hallo editor to take steps to migrate to the new Draftail editor as this external package is unlikely to have ongoing maintenance. window.registerHalloPlugin will no longer be created on the page editor load, unless the legacy package is installed.
clean_name on AbstractFormFieldIf you are upgrading a pre-2.10 project that uses the Wagtail form builder, and has existing form submission data that needs to be preserved, you must first upgrade to a version between 2.10 and 2.16, and run migrations and start the application server, before upgrading to 3.0. This ensures that the clean_name field introduced in Wagtail 2.10 is populated. The mechanism for doing this (which had a dependency on the Unidecode package) has been dropped in Wagtail 3.0. Any new form fields created under Wagtail 2.10 or above use the AnyAscii library instead.
Jinja2 2.x is no longer supported as of this release; if you are using Jinja2 templating on your project, please upgrade to Jinja2 3.0 or above.
Various changes have been made to the internal API for defining panel types, previously known as edit handlers. As noted above, the module wagtail.admin.edit_handlers has been renamed to wagtail.admin.panels, and wagtail.contrib.forms.edit_handlers is renamed to wagtail.contrib.forms.panels.
Additionally, the base wagtail.admin.edit_handlers.EditHandler class has been renamed to wagtail.admin.panels.Panel, and wagtail.admin.edit_handlers.BaseCompositeEditHandler has been renamed to wagtail.admin.panels.PanelGroup.
Template paths have also been renamed accordingly - templates previously within wagtailadmin/edit_handlers/ are now located under wagtailadmin/panels/, and wagtailforms/edit_handlers/form_responses_panel.html is now at wagtailforms/panels/form_responses_panel.html.
Where possible, third-party packages that implement their own field panel types should be updated to allow using a plain FieldPanel instead, in line with Wagtail dropping its own special-purpose field panel types such as StreamFieldPanel and ImageChooserPanel. The steps for doing this will depend on the package's functionality, but in general:
Widget class that produces your desired HTML rendering.widget_overrides method, your code should instead call register_form_field_override so that the desired widget is always selected for the relevant model field type.get_comparison_class method, your code should instead call wagtail.admin.compare.register_comparison_class to register the comparison class against the relevant model field type.Within the Panel class, the methods widget_overrides, required_fields and required_formsets have been deprecated in favor of a new get_form_options method that returns a dict of configuration options to be passed on to the generated form class:
required_fields should instead return this value as a fields item in the dict returned from get_form_optionsrequired_formsets should instead return this value as a formsets item in the dict returned from get_form_optionswidget_overrides should instead return this value as a widgets item in the dict returned from get_form_optionsThe methods on_request_bound, on_instance_bound and on_form_bound are no longer used. In previous versions, over the course of serving a request an edit handler would have the attributes request, model, instance and form attached to it, with the corresponding on_*_bound method being called at that point. In the new implementation, only the model attribute and on_model_bound method are still available. This means it is no longer possible to vary or patch the form class in response to per-request information such as the user object. For permission checks, you should use the new permission option on FieldPanel; for other per-request customizations to the form object, use a custom form class with an overridden __init__ method. (The current user object is available from the form as self.for_user.)
Binding to a request, instance and form object is now handled by a new class Panel.BoundPanel. Any initialization logic previously performed in on_request_bound, on_instance_bound or on_form_bound can instead be moved to the constructor method of a subclass of BoundPanel:
class CustomPanel(Panel):
class BoundPanel(Panel.BoundPanel):
def __init__(self, **kwargs):
super().__init__(**kwargs)
# The attributes self.panel, self.request, self.instance and self.form
# are available here
The template context for panels derived from BaseChooserPanel has changed. BaseChooserPanel is deprecated and now functionally identical to FieldPanel; as a result, the context variable is_chosen, and the variable name given by the panel's object_type_name property, are no longer available on the template. The only available variables are now field and show_add_comment_button. If your template depends on these additional variables, you will need to pass them explicitly by overriding the BoundPanel.get_context_data method.
Some changes of behavior have been made to ModelAdmin as a result of the panel API changes:
get_form_class method of a ModelAdmin CreateView or EditView to pass a custom form class, that form class must now inherit from wagtail.admin.forms.models.WagtailAdminModelForm. Passing a plain Django ModelForm subclass is no longer valid.ModelAdmin.get_form_fields_exclude method is no longer passed a request argument. Subclasses that override this method should remove this from the method signature. If the request object is being used to vary the set of fields based on the user's permission, this can be replaced with the new permission option on FieldPanel.ModelAdmin.get_edit_handler method is no longer passed a request or instance argument. Subclasses that override this method should remove this from the method signature.content_json TextField with content JSONField in PageRevisionThe content_json field in the PageRevision model has been renamed to content, and this field now internally uses JSONField instead of TextField. If you have a large number of PageRevision objects, running the migrations might take a while.
data_json TextField with data JSONField in BaseLogEntryThe data_json field in the BaseLogEntry model (and its subclasses PageLogEntry and ModelLogEntry) has been renamed to data, and this field now internally uses JSONField instead of TextField. If you have a large number of objects for these models, running the migrations might take a while.
If you have models that are subclasses of BaseLogEntry in your project, be careful when generating new migrations for these models. As the field is changed and renamed at the same time, Django's makemigrations command will generate RemoveField and AddField operations instead of AlterField and RenameField. To avoid data loss, make sure to adjust the migrations accordingly. For example with a model named MyCustomLogEntry, change the following operations:
operations = [
migrations.RemoveField(
model_name="mycustomlogentry",
name="data_json",
),
migrations.AddField(
model_name="mycustomlogentry",
name="data",
field=models.JSONField(blank=True, default=dict),
),
]
to the following operations:
operations = [
migrations.AlterField(
model_name="mycustomlogentry",
name="data_json",
field=models.JSONField(blank=True, default=dict),
),
migrations.RenameField(
model_name="mycustomlogentry",
old_name="data_json",
new_name="data",
),
]
form_data TextField with JSONField in AbstractFormSubmissionThe form_data field in the AbstractFormSubmission model (and its subclasses FormSubmission) has been converted to JSONField instead of TextField. If you have customizations that programmatically add form submissions you will need to ensure that the form_data that is output is no longer a JSON string but instead a serializable Python object. When interacting with the form_data you will now receive a Python object and not a string.
Example change
def process_form_submission(self, form):
self.get_submission_class().objects.create(
# form_data=json.dumps(form.cleaned_data, cls=DjangoJSONEncoder),
form_data=form.cleaned_data, # new
page=self,
user=form.user,
)
size argument from wagtail.utils.sendfile_streaming_backend.was_modified_sinceThe size argument of the undocumented wagtail.utils.sendfile_streaming_backend.was_modified_since function has been removed. This argument was used to add a length parameter to the HTTP header; however, this was never part of the HTTP/1.0 and HTTP/1.1 specifications see RFC7232 and existed only as a an unofficial implementation in IE browsers.
Added API documentation for panels
Changes from 3.0rc2:
use_json_field argument on StreamField required until Wagtail 5.0Update release notes and wagtail updatemodulepaths command to cover rename from wagtail.core.utils to wagtail.coreutils
Changes from rc1:
wagtail updatemodulepaths command to cover rename from wagtail.core.utils to wagtail.coreutilsPhase out special-purpose panel types (StreamFieldPanel, RichTextFieldPanel, ImageChooserPanel, DocumentChooserPanel, PageChooserPanel, SnippetChooser
StreamFieldPanel, RichTextFieldPanel, ImageChooserPanel, DocumentChooserPanel, PageChooserPanel, SnippetChooserPanel) in favour of FieldPanel (Matt Westcott):focus-visible for cross-browser consistency (Paarth Agarwal)modelAdmin (Serafeim Papastefanos)README.md logo to work for GitHub dark mode (Paarth Agarwal)If-Modified-Since header in sendfile_streaming_backend which was only used by IE (Mariusz Felisiak)StreamField to use JSONField to store data, rather than TextField (Sage Abdullah)content_json TextField with content JSONField in PageRevision (Sage Abdullah)replace_text management command (Sage Abdullah)data_json TextField with data JSONField in BaseLogEntry (Sage Abdullah)page_description to the Page model, to provide help text for a given page type (Kalob Taulien, Thibaud Colas, Matt Westcott)trimmed attribute to all blocktrans tags, so spacing is more reliable in translated strings (Harris Lapiroff)ModelAdmin to manage Tags (Abdulmajeed Isa)BASE_URL (undocumented) to WAGTAILADMIN_BASE_URL and add to documentation, BASE_URL will be removed in a future release (Sandil Ranasinghe)AbstractEmailForm (Jake Howard)WAGTAILIMAGES_RENDITION_STORAGE setting to allow an alternative image rendition storage (Heather White)wagtail_update_image_renditions management command to regenerate image renditions or purge all existing renditions (Hitansh Shah, Onno Timmerman, Damian Moore)PageQuerySet.specific() to reduce memory consumption (Andy Babic)TAG_SPACES_ALLOWED is True or False (Abdulmajeed Isa)AbstractFormSubmission's form_data to use JSONField to store form submissions (Jake Howard)simple_translations ensure that the user is redirected to the page edit view when submitting for a single locale (Mitchel Cabuloy)Form pages, ensure that all added fields are correctly shown in the preview (Joshua Munn)WAGTAILDOCS_CONTENT_TYPES & WAGTAILDOCS_INLINE_CONTENT_TYPES ensure that the filename is correctly set in the Content-Disposition header so that saving the files will use the correct filename (John-Scott Atlakson)aria-haspopup="menu" for all sidebar menu items that have sub-menus (LB (Ben Johnston))aria-expanded is always explicitly set as a string in sidebar (LB (Ben Johnston))role="main" attributes on <main> elements causing HTML validation issues (Luis Espinoza)lang attributes to <html> elements (James Ray)thumb_col_header_text is correctly used by ThumbnailMixin within ModelAdmin as the column header label (Kyle J. Roux)exclude_fields_in_copy (John-Scott Atlakson)IntegrityError when publishing pages with translatable Orderables that were copied without being published (Kalob Taulien, Dan Braghis)GenericRelation when copying pages (John-Scott Atlakson)Fix: Ensure the upgrade notification request for the latest release, which can be disabled via the WAGTAIL_ENABLE_UPDATE_CHECK sends the referrer orig
WAGTAIL_ENABLE_UPDATE_CHECK sends the referrer origin with strict-origin-when-cross-origin (Karl Hobley)September 5, 2022
---
local:
depth: 1
---
WAGTAIL_ENABLE_UPDATE_CHECK sends the referrer origin with strict-origin-when-cross-origin (Karl Hobley)Fix: Update django-treebeard dependency to 4.5.1 or above (Serafeim Papastefanos)
FormPagesListView in wagtail.contrib.forms to avoid undefined locale variable when subclassing (Dan Braghis)exclude_fields_in_copy (John-Scott Atlakson)IntegrityError when publishing pages with translatable Orderables that were copied without being published (Kalob Taulien, Dan Braghis)GenericRelation when copying pages (John-Scott Atlakson)April 11, 2022
---
local:
depth: 1
---
FormPagesListView in wagtail.contrib.forms to avoid undefined locale variable when subclassing (Dan Braghis)exclude_fields_in_copy (John-Scott Atlakson)Orderables when page is copied without being published (Kalob Taulien, Dan Braghis)GenericRelation when copying pages (John-Scott Atlakson)Developers using Jinja2 templating should note that the template tags in this release (and earlier releases in the 2.15.x and 2.16.x series) are compatible with Jinja2 2.11.x and 3.0.x. Jinja2 2.11.x is unmaintained and requires markupsafe to be pinned to version <2.1 to work; Jinja2 3.1.x has breaking changes and is not compatible. We therefore recommend that you use Jinja2 3.0.x, or 2.11.x with fully pinned dependencies.
Fix: Ensure that correct sidebar submenus open when labels use non-Latin alphabets (Matt Westcott)
USE_THOUSAND_SEPARATOR (Dennis McGregor)February 11, 2022
Ensure that correct sidebar submenus open when labels use non-Latin alphabets (Matt Westcott)
Fix issue where invalid bulk action URLs would incorrectly trigger a server error (500) instead of a valid not found (404) (Ihor Marhitych)
Fix issue where bulk actions would not work for object IDs greater than 999 when USE_THOUSAND_SEPARATOR (Dennis McGregor)
Set cookie for sidebar collapsed state to "SameSite: lax" (LB (Ben Johnston))
Prevent error on creating automatic redirects for sites with non-standard ports (Matt Westcott)
Restore ability to customize admin UI colors via CSS (LB (Ben Johnston))
Fix: default_app_config deprecations for Django >= 3.2 (Tibor Leupold)
page_slug_changed signal for pages (Andy Babic)StreamField, StreamBlock, and ListBlock which will load all sub-blocks initially collapsed (Matt Westcott)alias_of field to the pages API (Dmitrii Faiazov)search_fields (LB (Ben Johnston))admin/expanding_formset.js has been renamed to admin/expanding-formset.js (LB (Ben Johnston))wagtail_site template tag for Jinja2 (Vladimir Tananko)default_app_config deprecations for Django >= 3.2 (Tibor Leupold)first_published_date and last_published_date (Dan Braghis)WAGTAILADMIN_USER_LOGIN_FORM are now rendered correctly (Michael Karamuth)ol items are not cut off (Khanh Hoang)3.2, 4.0
3.7, 3.8, 3.9, 3.10
2.15 LTS
3.0, 3.1, 3.2
3.6, 3.7, 3.8, 3.9, 3.10
February 7, 2022
---
local:
depth: 1
---
This release adds support for Django 4.0.
As part of a wider redesign of Wagtail’s administration interface, we have replaced the sidebar with a slim, keyboard-friendly version. This re-implementation comes with significant accessibility improvements for keyboard and screen reader users, and will enable us to make navigation between views much snappier in the future. Please have a look at upgrade considerations for more details on differences with the previous version.
Wagtail projects using the wagtail.contrib.redirects app now benefit from 'automatic redirect creation' - which creates redirects for pages and their descedants whenever a URL-impacting change is made; such as a slug being changed, or a page being moved to a different part of the tree.
This feature should be beneficial to most 'standard' Wagtail projects and, in most cases, will have only a minor impact on responsiveness when making such changes. However, if you find this feature is not a good fit for your project, you can disabled it by adding the following to your project settings:
WAGTAILREDIRECTS_AUTO_CREATE = False
Thank you to The National Archives for kindly sponsoring this feature.
page_slug_changed signal for Pages (Andy Babic)StreamField, StreamBlock, and ListBlock which will load all sub-blocks initially collapsed (Matt Westcott)alias_of field to the pages API (Dmitrii Faiazov)default_app_config deprecations for Django >= 3.2 (Tibor Leupold)search_fields (LB (Ben Johnston))wagtail_site template tag for Jinja2 (Vladimir Tananko)first_published_date and last_published_date (Dan Braghis)WAGTAILADMIN_USER_LOGIN_FORM are now rendered correctly (Michael Karamuth)ol items are not cut off (Khanh Hoang)(2.16_upgrade_considerations)=
Django 3.0 and 3.1 are no longer supported as of this release; please upgrade to Django 3.2 or above before upgrading Wagtail.
Python 3.6 is no longer supported as of this release; please upgrade to Python 3.7 or above before upgrading Wagtail.
ListValue rather than a list instanceThe data type returned as the value of a ListBlock is now a custom class, ListValue, rather than a Python list object. This change allows it to provide a bound_blocks property that exposes the list items as BoundBlock objects rather than plain values. ListValue objects are mutable sequences that behave similarly to lists, and so all code that iterates over them, accesses individual elements, or manipulates them should continue to work. However, code that specifically expects a list object (e.g. using isinstance or testing for equality against a list) may need to be updated. For example, a unit test that tests the value of a ListBlock as follows:
self.assertEqual(page.body[0].value, ["hello", "goodbye"])
should be rewritten as:
self.assertEqual(list(page.body[0].value), ["hello", "goodbye"])
set method on tag fieldsThis release upgrades the django-taggit library to 2.x, which introduces one breaking change: the TaggableManager.set method now accepts a list of tags as a single argument, rather than a variable number of arguments. Code such as page.tags.set('red', 'blue') should be updated to page.tags.set(['red', 'blue']).
wagtail.admin.views.generic.DeleteView follows Django 4.0 conventionsThe internal (undocumented) class-based view wagtail.admin.views.generic.DeleteView has been updated to align with Django 4.0's DeleteView implementation, which uses FormMixin to handle POST requests. Any custom deletion logic in delete() handlers should be moved to form_valid().
admin/expanding_formset.js has been renamed to admin/expanding-formset.js as part of frontend code clean up work. Check for any customized admin views that are extending expanding formsets, or have overridden template and copied the previous file name used in an import as these may need updating.
The new sidebar largely supports the same customizations as its predecessor, with a few exceptions:
icon_name, so they can be visually distinguished when the sidebar is collapsed.MenuItem and its sub-classes no longer supports customizing arbitrary HTML attributes.MenuItem can no longer be sub-classed to customize its HTML output or load additional JavaScriptFor sites relying on those capabilities, we provide a WAGTAIL_SLIM_SIDEBAR = False setting to switch back to the legacy sidebar. The legacy sidebar and this setting will be removed in Wagtail 2.18.
Fix: default_app_config deprecations for Django >= 3.2 (Tibor Leupold)
Changes from 2.16rc1:
Full 2.16 changelog:
page_slug_changed signal for pages (Andy Babic)StreamField, StreamBlock, and ListBlock which will load all sub-blocks initially collapsed (Matt Westcott)alias_of field to the pages API (Dmitrii Faiazov)search_fields (LB (Ben Johnston))admin/expanding_formset.js has been renamed to admin/expanding-formset.js (LB (Ben Johnston))wagtail_site template tag for Jinja2 (Vladimir Tananko)default_app_config deprecations for Django >= 3.2 (Tibor Leupold)first_published_date and last_published_date (Dan Braghis)WAGTAILADMIN_USER_LOGIN_FORM are now rendered correctly (Michael Karamuth)ol items are not cut off (Khanh Hoang)Fix: default_app_config deprecations for Django >= 3.2 (Tibor Leupold)
page_slug_changed signal for pages (Andy Babic)StreamField, StreamBlock, and ListBlock which will load all sub-blocks initially collapsed (Matt Westcott)alias_of field to the pages API (Dmitrii Faiazov)search_fields (LB (Ben Johnston))admin/expanding_formset.js has been renamed to admin/expanding-formset.js (LB (Ben Johnston))wagtail_site template tag for Jinja2 (Vladimir Tananko)default_app_config deprecations for Django >= 3.2 (Tibor Leupold)first_published_date and last_published_date (Dan Braghis)WAGTAILADMIN_USER_LOGIN_FORM are now rendered correctly (Michael Karamuth)ol items are not cut off (Khanh Hoang)Fix: Ensure the upgrade notification request for the latest release, which can be disabled via the WAGTAIL_ENABLE_UPDATE_CHECK sends the referrer orig
WAGTAIL_ENABLE_UPDATE_CHECK sends the referrer origin with strict-origin-when-cross-origin (Karl Hobley)September 5, 2022
Ensure the upgrade notification request for the latest release, which can be disabled via the WAGTAIL_ENABLE_UPDATE_CHECK sends the referrer origin with strict-origin-when-cross-origin (Karl Hobley)
On the Locked pages report, limit the "locked by" filter to just users who have locked pages (Stefan Hammer)
Ensure Python 3.10 compatibility when using Elasticsearch backend (Przemysław Buczkowski, Matt Westcott)
Fix: Allow bulk publishing of pages without revisions (Andy Chosak)
IntegrityError when publishing pages with translatable Orderables that were copied without being published (Kalob Taulien, Dan Braghis)GenericRelation when copying pages (John-Scott Atlakson)April 11, 2022
Allow bulk publishing of pages without revisions (Andy Chosak)
Ensure that all descendant pages are logged when deleting a page, not just immediate children (Jake Howard)
Generate new translation keys for translatable Orderable when page is copied without being published (Kalob Taulien, Dan Braghis)
Ignore GenericRelation when copying pages (John-Scott Atlakson)
Developers using Jinja2 templating should note that the template tags in this release (and earlier releases in the 2.15.x series) are compatible with Jinja2 2.11.x and 3.0.x. Jinja2 2.11.x is unmaintained and requires markupsafe to be pinned to version <2.1 to work; Jinja2 3.1.x has breaking changes and is not compatible. We therefore recommend that you use Jinja2 3.0.x, or 2.11.x with fully pinned dependencies.
Fix: Fix issue where invalid bulk action URLs would incorrectly trigger a server error (500) instead of a valid not found (404) (Ihor Marhitych)
USE_THOUSAND_SEPARATOR (Dennis McGregor)February 11, 2022
Fix issue where invalid bulk action URLs would incorrectly trigger a server error (500) instead of a valid not found (404) (Ihor Marhitych)
Fix issue where bulk actions would not work for object IDs greater than 999 when USE_THOUSAND_SEPARATOR (Dennis McGregor)
Fix syntax when logging image rendition generation (Jake Howard)
Fix: Implement correct check for SQLite installations without full-text search support (Matt Westcott)
January 26, 2022
Implement correct check for SQLite installations without full-text search support (Matt Westcott)
Fix: CVE-2022-21683 - Comment reply notifications sent to incorrect users (Ihor Marhitych, Jacob Topp-Mugglestone)
checkbox_aria_label is used correctly in the Bulk Actions checkboxes (Vu Pham)January 18, 2022
This release addresses an information disclosure issue in Wagtail's commenting feature. Previously, when notifications for new replies in comment threads were sent, they were sent to all users who had replied or commented anywhere on the site, rather than only in the relevant threads. This meant that a user could listen in to new comment replies on pages they did not have editing access to, as long as they had left a comment or reply somewhere on the site.
Many thanks to Ihor Marhitych for reporting this issue. For further details, please see the CVE-2022-21683 security advisory.
Fixed transform operations in Filter.run() when image has been re-oriented (Justin Michalicek)
Remove extraneous header action buttons when creating or editing workflows and tasks (Matt Westcott)
Ensure that bulk publish actions pick up the latest draft revision (Matt Westcott)
Ensure the checkbox_aria_label is used correctly in the Bulk Actions checkboxes (Vu Pham)
Prevent error on MySQL search backend when searching three or more terms (Aldán Creo)
Allow wagtail.search app migrations to complete on versions of SQLite without full-text search support (Matt Westcott)
Update Pillow dependency to allow 9.x (Matt Westcott)
This release restores the ability to run Wagtail against installations of SQLite that do not include the fts5 extension for full-text search support. On these installations, the fallback search backend (without support for full-text queries) will be used, and the database table for storing indexed content will not be created.
If SQLite is subsequently upgraded to a version with fts5 support, existing databases will still be missing this table, and full-text search will continue to be unavailable until it is created. To correct this, first make a backup copy of the database (since rolling back the migration could potentially reverse other schema changes), then run:
./manage.py migrate wagtailsearch 0005
./manage.py migrate
./manage.py update_index
Additionally, since the database search backend now needs to run a query on initialization to check for the presence of this table, calling wagtail.search.backends.get_search_backend during application startup may now fail with a "Models aren't loaded yet" error. Code that does this should be updated to only call get_search_backend at the point when a search query is to be performed.
Fix: Fix syntax when logging image rendition generation (Jake Howard)
csrf_token issue when using the Approve or Unlock buttons on pages on the Wagtail admin home (Matt Westcott)November 11, 2021
Fix syntax when logging image rendition generation (Jake Howard)
Increase version range for django-filter dependency (Serafeim Papastefanos)
Prevent bulk action checkboxes from displaying on page reports and other non-explorer listings (Matt Westcott)
Fix errors on publishing pages via bulk actions (Matt Westcott)
Fix csrf_token issue when using the Approve or Unlock buttons on pages on the Wagtail admin home (Matt Westcott)
Add initial support for Django 4.0 deprecations (Matt Westcott, Jochen Wersdörfer)
TypedTableBlock block type for StreamField, for building tables with mixed data types (Matt Westcott, Coen van der Kamp, Scott Cranfill. Sponsored by YouGov)min_num / max_num options on ListBlock (Matt Westcott)contrib.simple_translation (Mitchel Cabuloy)background_position_style property to renditions (Karl Hobley)wagtail.copy_for_translation log action type (Karl Hobley)'listing_results' (Matt Westcott)request.is_ajax() usage in Documents, Image and Snippet views (Matt Westcott)page_title and page_subtitle are used consistently (Matt Westcott)non_field_errors rendering in Workflow action modal (LB (Ben Johnston))get_image_model and get_document_model at import time (Matt Westcott)ExcelDateFormatter to wagtail.admin.views.mixins so that dates in Excel exports will appear in the locale's SHORT_DATETIME_FORMAT (Andrew Stone)label_format attribute to customise the label shown for a collapsed StructBlock (Matt Westcott)ImageFileMixin to extract shared file handling methods from AbstractImage and AbstractRendition (Fabien Le Frapper)before_delete_page and register_permissions examples to Hooks documentation (Jane Liu, Daniel Fairhead)nl_NL to nl (Loïc Teixeira, Coen van der Kamp)RoutablePageMixin (Nick Smith)autocomplete, a separate method which performs partial matching on specific autocomplete fields. This is useful for suggesting pages to the user in real-time as they type their query. (Karl Hobley, Matt Westcott)request.preview_mode so that template rendering can vary based on preview mode (Andy Chosak)blocks.MultipleChoiceBlock, forms.CheckboxSelectMultiple and ArrayField checkboxes will now stack instead of display inline to align with all other checkboxes fields (Seb Brown)RichText so ConfigException is not thrown (Alex Tomkins)default_auto_field in postgres_search AppConfig (Nick Moreton)EmailNotificationMixin and send_notification should only send emails to active users (Bryan Williams)gettext_lazy to ModelAdmin built in view titles so that language settings are correctly used (Matt Westcott)edit_handler usage by adding missing bind_to call to PreviewOnEdit view (Stefan Hammer)comments to wagtail_admin_comments to avoid conflicts with third-party commenting apps (Matt Westcott)MultiFieldPanel (Jérôme Lebleu)November 4, 2021
Wagtail 2.15 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).
Wagtail has a new search backend that uses the full-text search features of the database in use. It supports SQLite, PostgreSQL, MySQL, and MariaDB.
This new search backend replaces both the existing generic database and PostgreSQL-specific search backends.
To switch to this new backend, see the upgrade considerations below.
This feature was developed by Aldán Creo as part of Google Summer of Code.
Bulk actions are now available for Page, User, Image, and Document models in the Wagtail Admin, allowing users to perform actions like publication or deletion on groups of objects at once.
This feature was developed by Shohan Dutta Roy, mentored by Dan Braghis, Jacob Topp-Mugglestone, and Storm Heg.
Audit logging has been extended so that all models (not just pages) can have actions logged against them. The Site History report now includes logs from all object types and snippets and ModelAdmin provide a history view showing previous edits to an object. This feature was developed by Matt Westcott, and sponsored by The Motley Fool.
Permission for managing collections can now be assigned to individual subtrees of the collection hierarchy, allowing sub-teams within a site to control how their images and documents are organized. For more information, see collection_management_permissions. This feature was developed by Cynthia Kiser.
A new TypedTableBlock block type is available for StreamField, allowing authors to create tables where the cell values are any StreamField block type, including rich text. For more information, see /reference/contrib/typed_table_block. This feature was developed by Matt Westcott, Coen van der Kamp and Scott Cranfill, and sponsored by YouGov.
As part of a broad push to improve the accessibility of the administration interface, Wagtail now supports Windows high contrast mode. There are remaining known issues but we are confident Wagtail is now much more usable for people relying on this assistive technology.
Individual fixes were implemented by a large number of first-time and seasoned contributors:
Comments icon now matches link color (Dmitrii Faiazov, LB (Ben Johnston))
Sidebar logo is now visible in high contrast mode (Dmitrii Faiazov, LB (Ben Johnston))
Icons in links and buttons now use the appropriate “active control” color (Dmitrii Faiazov, LB (Ben Johnston))
Comments dropdown now has a border (Shariq Jamil, LB (Ben Johnston))
Make StreamField block chooser menu buttons appear as buttons (Dmitrii Faiazov, LB (Ben Johnston))
Add a separator to identify the search forms (Dmitrii Faiazov, LB (Ben Johnston))
Update tab styles so the active tab can be identified (Dmitrii Faiazov, LB (Ben Johnston))
Make hamburger menu a button for tab and high contrast accessibility (Amy Chan, Dan Braghis)
Tag fields now have the correct background (Desai Akshata, LB (Ben Johnston))
Added sidebar vertical separation with main content (Onkar Apte, LB (Ben Johnston))
Added vertical separation between field panels (Chakita Muttaraju, LB (Ben Johnston))
Switch widgets on/off states are now visually distinguishable (Sakshi Uppoor, Thibaud Colas)
Checkbox widgets on/off states are now visually distinguishable (Thibaud Colas, Jacob Topp-Mugglestone, LB (Ben Johnston))
Particular thanks to LB, who reviewed almost all of those contributions, and Kyle Bayliss, who did the initial audit to identify High contrast mode issues.
Add the ability for the page chooser to convert external urls that match a page to internal links, see wagtailadmin_external_link_conversion (Jacob Topp-Mugglestone. Sponsored by The Motley Fool)
Added "Extending Wagtail" section to documentation (Matt Westcott)
Introduced template components, a standard mechanism for renderable objects in the admin (Matt Westcott)
Support min_num / max_num options on ListBlock (Matt Westcott)
Implemented automatic tree synchronisation for contrib.simple_translation (Mitchel Cabuloy)
Added a background_position_style property to renditions. This can be used to crop images using its focal point in the browser. See rendition_background_position_style (Karl Hobley)
Added a distinct wagtail.copy_for_translation log action type (Karl Hobley)
Add a debug logger around image rendition generation (Jake Howard)
Convert Documents and Images to class based views for easier overriding (Matt Westcott)
Isolate admin URLs for Documents and Images search listing results with the name 'listing_results' (Matt Westcott)
Removed request.is_ajax() usage in Documents, Image and Snippet views (Matt Westcott)
Simplify generic admin view templates plus ensure page_title and page_subtitle are used consistently (Matt Westcott)
Extend support for collapsing edit panels from just MultiFieldPanels to all kinds of panels (Fabien Le Frapper, Robbie Mackay)
Add object count to header within modeladmin listing view (Jonathan "Yoni" Knoll)
Add ability to return HTML in multiple image upload errors (Gordon Pendleton)
Upgrade internal JS tooling; Node v14 plus other smaller package upgrades (LB (Ben Johnston))
Add support for non_field_errors rendering in Workflow action modal (LB (Ben Johnston))
Support calling get_image_model and get_document_model at import time (Matt Westcott)
When copying a page, default the 'Publish copied page' field to false (Justin Slay)
Open Preview and Live page links in the same tab, except where it would interrupt editing a Page (Sagar Agarwal)
Added ExcelDateFormatter to wagtail.admin.views.mixins so that dates in Excel exports will appear in the locale's SHORT_DATETIME_FORMAT (Andrew Stone)
Add TIDAL support to the list of oEmbed providers (Wout De Puysseleir)
Add label_format attribute to customize the label shown for a collapsed StructBlock (Matt Westcott)
User Group permissions editing in the admin will now show all custom object permissions in one row instead of a separate table (Kamil Marut)
Create ImageFileMixin to extract shared file handling methods from AbstractImage and AbstractRendition (Fabien Le Frapper)
Add before_delete_page and register_permissions examples to Hooks documentation (Jane Liu, Daniel Fairhead)
Add clarity to modeladmin template override behavior in the documentation (Joe Howard, Dan Swain)
Add section about CSV exports to security documentation (Matt Westcott)
Add initial support for Django 4.0 deprecations (Matt Westcott, Jochen Wersdörfer)
Translations in nl_NL are moved to the nl po files. nl_NL translation files are deleted. Projects that use LANGUAGE_CODE = 'nl-nl' will automatically fallback to nl. (Loïc Teixeira, Coen van der Kamp)
Add documentation for how to redirect to a separate page on Form builder submissions using RoutablePageMixin (Nick Smith)
Refactored index listing views and made column sort-by headings more consistent (Matt Westcott)
The title field on Image and Document uploads will now default to the filename without the file extension and this behavior can be customized (LB Johnston)
Add support for Python 3.10 (Matt Westcott)
Introduce, autocomplete, a separate method which performs partial matching on specific autocomplete fields. This is useful for suggesting pages to the user in real-time as they type their query. (Karl Hobley, Matt Westcott)
Use SVG icons in modeladmin headers and StreamField buttons/headers (Jérôme Lebleu)
Add tags to existing Django registered checks (LB Johnston)
Upgrade admin frontend JS libraries jQuery to 3.6.0 (Fabien Le Frapper)
Added request.preview_mode so that template rendering can vary based on preview mode (Andy Chosak)
Delete button is now correct colour on snippets and modeladmin listings (Brandon Murch)
Ensure that StreamBlock / ListBlock-level validation errors are counted towards error counts (Matt Westcott)
InlinePanel add button is now keyboard navigatable (Jesse Menn)
Remove redundant 'clear' button from site root page chooser (Matt Westcott)
Make ModelAdmin IndexView keyboard-navigable (Saptak Sengupta)
Prevent error on refreshing page previews when multiple preview tabs are open (Alex Tomkins)
Menu sidebar hamburger icon on smaller viewports now correctly indicates it is a button to screen readers and can be accessed via keyboard (Amy Chan, Dan Braghis)
blocks.MultipleChoiceBlock, forms.CheckboxSelectMultiple and ArrayField checkboxes will now stack instead of display inline to align with all other checkboxes fields (Seb Brown)
Screen readers can now access login screen field labels (Amy Chan)
Admin breadcrumbs home icon now shows for users with access to a subtree only (Stefan Hammer)
Add handling of invalid inline styles submitted to RichText so ConfigException is not thrown (Alex Tomkins)
Ensure comment notifications dropdown handles longer translations without overflowing content (Krzysztof Jeziorny)
Set default_auto_field in postgres_search AppConfig (Nick Moreton)
Ensure admin tab JS events are handled on page load (Andrew Stone)
EmailNotificationMixin and send_notification should only send emails to active users (Bryan Williams)
Disable Task confirmation now shows the correct value for quantity of tasks in progress (LB Johnston)
Page history now works correctly when it contains changes by a deleted user (Dan Braghis)
Add gettext_lazy to ModelAdmin built in view titles so that language settings are correctly used (Matt Westcott)
Tabbing and keyboard interaction on the Wagtail userbar now aligns with ARIA best practices (Storm Heg)
Add full support for custom edit_handler usage by adding missing bind_to call to PreviewOnEdit view (Stefan Hammer)
Only show active (not disabled) tasks in the workflow task chooser (LB Johnston)
CSS build scripts now output to the correct directory paths on Windows (Vince Salvino)
Capture log output from style fallback to avoid noise in unit tests (Matt Westcott)
Nested InlinePanel usage no longer fails to save when creating two or more items (Indresh P, Rinish Sam, Anirudh V S)
Changed relation name used for admin commenting from comments to wagtail_admin_comments to avoid conflicts with third-party commenting apps (Matt Westcott)
CSS variables are now correctly used for the filtering menu in modeladmin (Noah H)
Panel heading attribute is no longer ignored when nested inside a MultiFieldPanel (Jérôme Lebleu)
The following search backends (configured in WAGTAILSEARCH_BACKENDS) have been deprecated:
wagtail.search.backends.db (the default if WAGTAILSEARCH_BACKENDS is not specified)
wagtail.contrib.postgres_search.backend
Both of these backends have now been replaced by wagtail.search.backends.database. This new backend supports all of the features of the PostgreSQL backend, and also supports other databases. It will be made the default backend in Wagtail 3.0. To enable the new backend, edit (or add) the WAGTAILSEARCH_BACKENDS setting as follows:
WAGTAILSEARCH_BACKENDS = {
'default': {
'BACKEND': 'wagtail.search.backends.database',
}
}
Also remove 'wagtail.contrib.postgres_search' from INSTALLED_APPS if this was previously set.
After switching to this backend, you will need to run the manage.py update_index management command to populate the search index (see update_index).
If you have used the PostgreSQL-specific SEARCH_CONFIG, this will continue to work as before with the new backend. For example:
WAGTAILSEARCH_BACKENDS = {
'default': {
'BACKEND': 'wagtail.search.backends.database',
'SEARCH_CONFIG': 'english',
}
}
However, as a PostgreSQL specific feature, this will be ignored when using a different database.
Several Wagtail hooks provide a mechanism for passing Python objects to be rendered as HTML inside admin views, and the APIs for these objects have been updated to adopt a common template components pattern. The affected objects are:
Homepage panels (as registered with the construct_homepage_panels hook)
Homepage summary items (as registered with the construct_homepage_summary_items hook)
Page action menu items (as registered with the register_page_action_menu_item and construct_page_action_menu hooks)
Snippet action menu items (as registered with the register_snippet_action_menu_item and construct_snippet_action_menu hooks)
User code that creates these objects should be updated to follow the component API. This will typically require the following changes:
Homepage panels should be made subclasses of wagtail.admin.ui.components.Component, and the render(self) method should be changed to render_html(self, parent_context). (Alternatively, rather than defining render_html, it may be more convenient to reimplement it with a template, as per creating_template_components.)
Summary item classes can continue to inherit from wagtail.admin.site_summary.SummaryItem (which is now a subclass of Component) as before, but:
Any template attribute should be changed to template_name;
Any place where the render(self) method is overridden should be changed to render_html(self, parent_context);
Any place where the get_context(self) method is overridden should be changed to get_context_data(self, parent_context).
Action menu items for pages and snippets can continue to inherit from wagtail.admin.action_menu.ActionMenuItem and wagtail.snippets.action_menu.ActionMenuItem respectively - these are now subclasses of Component - but:
Any template attribute should be changed to template_name;
Any get_context method should be renamed to get_context_data;
The get_url, is_shown, get_context_data and render_html methods no longer accept a request parameter. The request object is available in the context dictionary as context['request'].
When defining new action types for audit logging with the register_log_actions hook, it was previously possible to pass a callable as the message. This is now deprecated - to define a message that depends on the log entry's data, you should now create a subclass of wagtail.core.log_actions.LogFormatter. For example:
from django.utils.translation import gettext_lazy as _
from wagtail.core import hooks
@hooks.register('register_log_actions')
def additional_log_actions(actions):
def greeting_message(data):
return _('Hello %(audience)s') % {
'audience': data['audience'],
}
actions.register_action('wagtail_package.greet_audience', _('Greet audience'), greeting_message)
should now be rewritten as:
from django.utils.translation import gettext_lazy as _
from wagtail.core import hooks
from wagtail.core.log_actions import LogFormatter
@hooks.register('register_log_actions')
def additional_log_actions(actions):
@actions.register_action('wagtail_package.greet_audience')
class GreetingActionFormatter(LogFormatter):
label = _('Greet audience')
def format_message(self, log_entry):
return _('Hello %(audience)s') % {
'audience': log_entry.data['audience'],
}
Audit logging is now supported on all model types, not just pages, and so the PageLogEntry.objects.log_action method for logging actions performed on pages is deprecated in favor of the general-purpose log function. Code that calls PageLogEntry.objects.log_action should now import the log function from wagtail.core.log_actions and call this instead (all arguments are unchanged).
Additionally, for logging actions on non-Page models, it is generally no longer necessary to subclass BaseLogEntry; see audit_log for further details.
If this affects you or your organization, consider which alternative browsers you may be able to use. Wagtail is fully compatible with Microsoft Edge, Microsoft’s replacement for Internet Explorer. You may consider using its IE mode to keep access to IE11-only sites, while other sites and apps like Wagtail can leverage modern browser capabilities.
Before the autocomplete() method was introduced, the search method also did partial matching. This behavior is will be deprecated in a future release and you should either switch to the new autocomplete() method or pass partial_match=False into the search method to opt-in to the new behavior. The partial matching in search() will be completely removed in a future release. See: wagtailsearch_searching_pages
The related_name of the relation linking the Page and User models to admin comments has been changed from comments to wagtail_admin_comments, to avoid conflicts with third-party apps that implement commenting. If you have any code that references the comments relation (including fixture files), this should be updated to refer to wagtail_admin_comments instead. If this is not feasible, the previous behavior can be restored by adding WAGTAIL_COMMENTS_RELATION_NAME = 'comments' to your project's settings.
Reusable library code that needs to preserve backwards compatibility with previous Wagtail versions can find out the relation name as follows:
try:
from wagtail.core.models import COMMENTS_RELATION_NAME
except ImportError:
COMMENTS_RELATION_NAME = 'comments'
Bulk action views provide alternative routes to actions like publishing or copying a page. If your site relies on hooks like before_publish_page or before_copy_page to perform checks, or add additional functionality, those hooks will not be called on the corresponding bulk action views. If you want to add this to the bulk action views as well, use the new bulk action hooks: before_bulk_action and after_bulk_action.
Revised deprecation timeline for database search backends; existing sites will continue to use the wagtail.search.backends.db backend unless they 'opt…
Changes from 2.15rc1:
wagtail.search.backends.db backend unless they 'opt in' to the new wagtail.search.backends.database backend via WAGTAILSEARCH_BACKENDS; the new backend will become default in 2.17Add initial support for Django 4.0 deprecations (Matt Westcott, Jochen Wersdörfer)
TypedTableBlock block type for StreamField, for building tables with mixed data types (Matt Westcott, Coen van der Kamp, Scott Cranfill. Sponsored by YouGov)min_num / max_num options on ListBlock (Matt Westcott)contrib.simple_translation (Mitchel Cabuloy)background_position_style property to renditions (Karl Hobley)wagtail.copy_for_translation log action type (Karl Hobley)'listing_results' (Matt Westcott)request.is_ajax() usage in Documents, Image and Snippet views (Matt Westcott)page_title and page_subtitle are used consistently (Matt Westcott)non_field_errors rendering in Workflow action modal (LB (Ben Johnston))get_image_model and get_document_model at import time (Matt Westcott)ExcelDateFormatter to wagtail.admin.views.mixins so that dates in Excel exports will appear in the locale's SHORT_DATETIME_FORMAT (Andrew Stone)label_format attribute to customise the label shown for a collapsed StructBlock (Matt Westcott)ImageFileMixin to extract shared file handling methods from AbstractImage and AbstractRendition (Fabien Le Frapper)before_delete_page and register_permissions examples to Hooks documentation (Jane Liu, Daniel Fairhead)nl_NL to nl (Loïc Teixeira, Coen van der Kamp)RoutablePageMixin (Nick Smith)autocomplete, a separate method which performs partial matching on specific autocomplete fields. This is useful for suggesting pages to the user in real-time as they type their query. (Karl Hobley, Matt Westcott)request.preview_mode so that template rendering can vary based on preview mode (Andy Chosak)blocks.MultipleChoiceBlock, forms.CheckboxSelectMultiple and ArrayField checkboxes will now stack instead of display inline to align with all other checkboxes fields (Seb Brown)RichText so ConfigException is not thrown (Alex Tomkins)default_auto_field in postgres_search AppConfig (Nick Moreton)EmailNotificationMixin and send_notification should only send emails to active users (Bryan Williams)gettext_lazy to ModelAdmin built in view titles so that language settings are correctly used (Matt Westcott)edit_handler usage by adding missing bind_to call to PreviewOnEdit view (Stefan Hammer)comments to wagtail_admin_comments to avoid conflicts with third-party commenting apps (Matt Westcott)MultiFieldPanel (Jérôme Lebleu)Fix: Allow relation name used for admin commenting to be overridden to avoid conflicts with third-party commenting apps (Matt Westcott)
October 14, 2021
Allow relation name used for admin commenting to be overridden to avoid conflicts with third-party commenting apps (Matt Westcott)
Corrected badly-formed format strings in translations (Matt Westcott)
Page history now works correctly when it contains changes by a deleted user (Dan Braghis)
The admin commenting feature introduced in Wagtail 2.13 added a relation named comments to the Page and User models. This can cause conflicts with third-party apps that implement commenting functionality, and so this will be renamed to wagtail_admin_comments in Wagtail 2.15. Developers who are affected by this issue, and have thus been unable to upgrade to Wagtail 2.13 or above, can now "opt in" to the Wagtail 2.15 behavior by adding the following line to their project settings:
WAGTAIL_COMMENTS_RELATION_NAME = 'wagtail_admin_comments'
This will allow third-party commenting apps to work in Wagtail 2.14.2 alongside Wagtail's admin commenting functionality.
Reusable library code that needs to preserve backwards compatibility with previous Wagtail versions can find out the relation name as follows:
try:
from wagtail.core.models import COMMENTS_RELATION_NAME
except ImportError:
COMMENTS_RELATION_NAME = 'comments'
Fix: Prevent failure on Twitter embeds and others which return cache_age as a string (Matt Westcott)
August 12, 2021
Prevent failure on Twitter embeds and others which return cache_age as a string (Matt Westcott)
Fix Uncaught ReferenceError when editing links in Hallo (Cynthia Kiser)
Added ancestor_of API filter (Jaap Roes)
ancestor_of API filter (Jaap Roes)full_url property to image renditions (Shreyash Srivastava)WAGTAIL_WORKFLOW_ENABLED setting for enabling / disabling moderation workflows globally (Matt Westcott)max_width and max_height on EmbedBlock (Petr Dlouhý)DATETIME_FORMAT for localization in templates (Andrew Stone)construct_explorer_page_queryset hook is now taken into account again by the page explorer API (Andre Fonseca)APPEND_SLASH setting (Tidjani Dia)block.super to remaining extra_js & extra_css blocks (Andrew Stone)editor and features arguments on RichTextField are preserved by clone() (Daniel Fairhead)August 2, 2021
Added ancestor_of API filter. See apiv2_filter_by_tree_position. (Jaap Roes)
Added support for customizing group management views. See customizing_group_views. (Jan Seifert)
Added full_url property to image renditions (Shreyash Srivastava)
Added locale selector when choosing translatable snippets (Karl Hobley)
Added WAGTAIL_WORKFLOW_ENABLED setting for enabling / disabling moderation workflows globally (Matt Westcott)
Allow specifying max_width and max_height on EmbedBlock (Petr Dlouhý)
Add warning when StreamField is used without a StreamFieldPanel (Naomi Morduch Toubman)
Added keyboard and screen reader support to Wagtail user bar (LB Johnston, Storm Heg)
Added instructions on copying and aliasing pages to the editor's guide in documentation (Vlad Podgurschi)
Add Google Data Studio to the list of oEmbed providers (Petr Dlouhý)
Allow ListBlock to raise validation errors that are not attached to an individual child block (Matt Westcott)
Use DATETIME_FORMAT for localization in templates (Andrew Stone)
Added documentation on multi-site, multi-instance and multi-tenancy setups (Coen Van Der Kamp)
Updated Facebook / Instagram oEmbed endpoints to v11.0 (Thomas Kremmel)
Performance improvements for admin listing pages (Jake Howard, Dan Braghis, Tom Usher)
Invalid filter values for foreign key fields in the API now give an error instead of crashing (Tidiane Dia)
Ordering specified in the construct_explorer_page_queryset hook is now taken into account again by the page explorer API (Andre Fonseca)
Deleting a page from its listing view no longer results in a 404 error (Tidiane Dia)
The Wagtail admin urls will now respect the APPEND_SLASH setting (Tidiane Dia)
Prevent “Forgotten password” link from overlapping with field on mobile devices (Helen Chapman)
Snippet admin urls are now namespaced to avoid ambiguity with the primary key component of the url (Matt Westcott)
Prevent error on copying pages with ClusterTaggableManager relations and multi-level inheritance (Chris Pollard)
Prevent failure on root page when registering the Page model with ModelAdmin (Jake Howard)
Prevent error when filtering page search results with a malformed content_type (Chris Pollard)
Prevent multiple submissions of "update" form when uploading images / documents (Mike Brown)
Ensure HTML title is populated on project template 404 page (Matt Westcott)
Respect cache_age parameters on embeds (Gordon Pendleton)
Page comparison view now reflects request-level customizations to edit handlers (Matt Westcott)
Add block.super to remaining extra_js & extra_css blocks (Andrew Stone)
Ensure that editor and features arguments on RichTextField are preserved by clone() (Daniel Fairhead)
Rename 'spin' CSS animation to avoid clashes with other libraries (Kevin Gutiérrez)
Prevent crash when copying a page from a section where the user has no publish permission (Karl Hobley)
Ensure that rich text conversion correctly handles images / embeds inside links or inline styles (Matt Westcott)
Django 2.2 is no longer supported as of this release; please upgrade to Django 3.0 or above before upgrading Wagtail.
The Wagtail user bar (“edit bird”) widget now supports keyboard and screen reader navigation. To make the most of this, we now recommend placing the widget near the top of the page <body>, so users can reach it without having to go through the whole page. See wagtailuserbar_tag for more information.
For implementers of custom user bar menu items, we also now require the addition of role="menuitem" on the a element to provide the correct semantics. See construct_wagtail_userbar for more information.
As of June 2021, the procedure for setting up a Facebook app to handle Facebook / Instagram embedded content (see facebook_and_instagram_embeds) has changed. It is now necessary to activate the "oEmbed Read" feature on the app, and submit it to Facebook for review. Apps that activated the oEmbed Product before June 8, 2021 must be migrated to oEmbed Read by September 7, 2021 to continue working. No change to the Wagtail code or configuration is required.
Added ancestor_of API filter (Jaap Roes)
ancestor_of API filter (Jaap Roes)full_url property to image renditions (Shreyash Srivastava)WAGTAIL_WORKFLOW_ENABLED setting for enabling / disabling moderation workflows globally (Matt Westcott)max_width and max_height on EmbedBlock (Petr Dlouhý)DATETIME_FORMAT for localization in templates (Andrew Stone)construct_explorer_page_queryset hook is now taken into account again by the page explorer API (Andre Fonseca)APPEND_SLASH setting (Tidjani Dia)block.super to remaining extra_js & extra_css blocks (Andrew Stone)editor and features arguments on RichTextField are preserved by clone() (Daniel Fairhead)Fix: Allow relation name used for admin commenting to be overridden to avoid conflicts with third-party commenting apps (Matt Westcott)
October 14, 2021
Allow relation name used for admin commenting to be overridden to avoid conflicts with third-party commenting apps (Matt Westcott)
Corrected badly-formed format strings in translations (Matt Westcott)
Correctly handle non-numeric user IDs for deleted users in reports (Dan Braghis)
The admin commenting feature introduced in Wagtail 2.13 added a relation named comments to the Page and User models. This can cause conflicts with third-party apps that implement commenting functionality, and so this will be renamed to wagtail_admin_comments in Wagtail 2.15. Developers who are affected by this issue, and have thus been unable to upgrade to Wagtail 2.13 or above, can now "opt in" to the Wagtail 2.15 behavior by adding the following line to their project settings:
WAGTAIL_COMMENTS_RELATION_NAME = 'wagtail_admin_comments'
This will allow third-party commenting apps to work in Wagtail 2.13.5 alongside Wagtail's admin commenting functionality.
Reusable library code that needs to preserve backwards compatibility with previous Wagtail versions can find out the relation name as follows:
try:
from wagtail.core.models import COMMENTS_RELATION_NAME
except ImportError:
COMMENTS_RELATION_NAME = 'comments'
Fix: Prevent embed thumbnail_url migration from failing on URLs longer than 200 characters (Matt Westcott)
July 13, 2021
Prevent embed thumbnail_url migration from failing on URLs longer than 200 characters (Matt Westcott)
Fix: Prevent error when using rich text on views where commenting is unavailable (Jacob Topp-Mugglestone)
July 5, 2021
Prevent error when using rich text on views where commenting is unavailable (Jacob Topp-Mugglestone)
Include form media on account settings page (Matt Westcott)
Avoid error when rendering validation error messages on ListBlock children (Matt Westcott)
Prevent comments CSS from overriding admin UI color customizations (Matt Westcott)
Avoid validation error when editing rich text content preceding a comment (Jacob Topp-Mugglestone)
CVE-2021-32681 - fix improper escaping of HTML ('Cross-site Scripting') in Wagtail StreamField blocks (Karen Tracey, Matt Westcott)
CVE-2021-32681 - fix improper escaping of HTML ('Cross-site Scripting') in Wagtail StreamField blocks (Karen Tracey, Matt Westcott)
June 17, 2021
This release addresses a cross-site scripting (XSS) vulnerability in StreamField. When the {% include_block %} template tag is used to output the value of a plain-text StreamField block (CharBlock, TextBlock or a similar user-defined block derived from FieldBlock), and that block does not specify a template for rendering, the tag output is not properly escaped as HTML. This could allow users to insert arbitrary HTML or scripting. This vulnerability is only exploitable by users with the ability to author StreamField content (i.e. users with 'editor' access to the Wagtail admin).
Site implementers who wish to retain the existing behavior of allowing editors to insert HTML content in these blocks (and are willing to accept the risk of untrusted editors inserting arbitrary code) may disable the escaping by surrounding the relevant {% include_block %} tag in {% autoescape off %}...{% endautoescape %}.
Many thanks to Karen Tracey for reporting this issue. For further details, please see the CVE-2021-32681 security advisory.
Fix: Ensure comment notification checkbox is fully hidden when commenting is disabled (Karl Hobley)
June 1, 2021
Ensure comment notification checkbox is fully hidden when commenting is disabled (Karl Hobley)
Prevent commenting from failing for user models with UUID primary keys (Jacob Topp-Mugglestone)
Fix incorrect link in comment notification HTML email (Matt Westcott)
New StreamField implementation with performance and functionality improvements (Matt Westcott, Karl Hobley)
wagtail.contrib.simple_translation (Coen van der Kamp)min_num, max_num and block_counts arguments directly to StreamField (Haydn Greatnews, Matt Westcott)__year lookup in Elasticsearch queries (Seb Brown)type(), not_type(), exact_type() and not_exact_type() methods on PageQuerySet (Andy Babic)Page.get_specific() and added the copy_attrs_exclude option (Andy Babic)PageQueryset.specific(defer=True) to only perform a single database query (Andy Babic)PageQueryset.defer_streamfields() (Andy Babic)PageQuerySet.defer_streamfields() to improve efficiency in a few key places (Andy Babic)register_setting, register_settings_menu_item to use SVG icons (Thibaud Colas)SearchArea subclasses in register_admin_search_area (Thibaud Colas)wagtail.reorder page audit log action (Storm Heg)get_settings template tag now supports specifying the variable name with {% get_settings as var %} (Samir Shah){% pageurl %} fallback to be a direct URL or an object with a get_absolute_url method (Andy Babic)blank keyword argument (Matt Westcott){% include_block with context %} now passes local variables into the block template (Jonny Scholes)May 12, 2021
The StreamField editing interface has been rebuilt on a client-side rendering model, powered by the telepath library. This provides better performance, increased customizability and UI enhancements including the ability to duplicate blocks. For further background, see the blog post Telepath - the next evolution of StreamField.
This feature was developed by Matt Westcott and Karl Hobley and sponsored by YouGov, inspired by earlier work on react-streamfield completed by Bertrand Bordage through the Wagtail's First Hatch crowdfunder.
In Wagtail 2.12 we shipped the new localisation support, but in order to translate content an external library had to be used, such as wagtail-localize.
In this release, a new contrib app has been introduced called simple_translation. This allows you to create copies of pages and translatable snippets in other languages and translate them as regular Wagtail pages. It does not include any more advanced translation features such as using external services, PO files, or an interface that helps keep translations in sync with the original language.
This module was contributed by Coen van der Kamp.
The page editor now supports leaving comments on fields and StreamField blocks, by entering commenting mode (using the button in the top right of the editor). Inline comments are available in rich text fields using the Draftail editor.
This feature was developed by Jacob Topp-Mugglestone, Karl Hobley and Simon Evans and sponsored by The Motley Fool.
The "Account settings" section available at the bottom of the admin menu has been updated to include all settings on a single form. This feature was developed by Karl Hobley.
The redirects module now includes support for exporting the list of redirects to XLSX or CSV. This feature was developed by Martin Sandström.
The documentation now uses our brand new Sphinx Wagtail Theme, with a search feature powered by Algolia DocSearch.
Feedback and feature requests for the theme may be reported to the sphinx_wagtail_theme issue list, and to Wagtail’s issues for the search.
Thank you to Storm Heg, Tibor Leupold, Thibaud Colas, Coen van der Kamp, Olly Willans, Naomi Morduch Toubman, Scott Cranfill, and Andy Chosak for making this happen!
Django 3.2 is formally supported in this release. Note that Wagtail 2.13 will be the last release to support Django 2.2.
Support passing min_num, max_num and block_counts arguments directly to StreamField (Haydn Greatnews, Matt Westcott)
Add the option to set rich text images as decorative, without alt text (Helen Chapman, Thibaud Colas)
Add support for __year filter in Elasticsearch queries (Seb Brown)
Add PageQuerySet.defer_streamfields() (Andy Babic)
Utilize PageQuerySet.defer_streamfields() to improve efficiency in a few key places (Andy Babic)
Support passing multiple models as arguments to type(), not_type(), exact_type() and not_exact_type() methods on PageQuerySet (Andy Babic)
Update default attribute copying behaviour of Page.get_specific() and added the copy_attrs_exclude option (Andy Babic)
Update PageQueryset.specific(defer=True) to only perform a single database query (Andy Babic)
Switched register_setting, register_settings_menu_item to use SVG icons (Thibaud Colas)
Add support to SVG icons for SearchArea subclasses in register_admin_search_area (Thibaud Colas)
Add specialized wagtail.reorder page audit log action. This was previously covered by the wagtail.move action (Storm Heg)
get_settings template tag now supports specifying the variable name with {% get_settings as var %} (Samir Shah)
Reinstate submitter's name on moderation notification email (Matt Westcott)
Add a new switch input widget as an alternative to checkboxes (Karl Hobley)
Allow {% pageurl %} fallback to be a direct URL or an object with a get_absolute_url method (Andy Babic)
Support slicing on StreamField / StreamBlock values (Matt Westcott)
Switch Wagtail choosers to use SVG icons instead of font icon (Storm Heg)
Save revision when restart workflow (Ihor Marhitych)
Add a visible indicator of unsaved changes to the page editor (Jacob Topp-Mugglestone)
StreamField required status is now consistently handled by the blank keyword argument (Matt Westcott)
Show 'required' asterisks for blocks inside required StreamFields (Matt Westcott)
Make image chooser "Select format" fields translatable (Helen Chapman, Thibaud Colas)
Fix pagination on 'view users in a group' (Sagar Agarwal)
Prevent page privacy menu from being triggered by pressing enter on a char field (Sagar Agarwal)
Validate host/scheme of return URLs on password authentication forms (Susan Dreher)
Reordering a page now includes the correct user in the audit log (Storm Heg)
Fix reverse migration errors in images and documents (Mike Brown)
Make "Collection" and "Parent" form field labels translatable (Thibaud Colas)
Apply enough chevron padding to all applicable select elements (Scott Cranfill)
Reduce database queries in the page edit view (Ihor Marhitych)
Wagtail 2.13 will be the last Wagtail release to support IE11. Users accessing the admin with IE11 will be shown a warning message advising that support is being phased out.
The rules for determining whether a StreamField is required (i.e. at least one block must be provided) have been simplified and made consistent with other field types. Non-required fields are now indicated by blank=True on the StreamField definition; the default is blank=False (the field is required). In previous versions, to make a field non-required, it was necessary to define a top-level StreamBlock with required=False (which applied the validation rule) as well as setting blank=True (which removed the asterisk from the form field). You should review your use of StreamField to check that blank=True is used on the fields you wish to make optional.
For the majority of cases, the new StreamField implementation in this release will be a like-for-like upgrade, and no code changes will be necessary - this includes projects where custom block types have been defined by extending StructBlock, ListBlock and StreamBlock. However, certain complex customizations may need to be reimplemented to work with the new client-side rendering model:
When customizing the form template for a StructBlock using the form_template attribute, the HTML of each child block must be enclosed in an element with a data-contentpath attribute equal to the block's name. This attribute is used by the commenting framework to attach comments to the correct fields. See custom_editing_interfaces_for_structblock.
If a StructBlock subclass overrides the get_form_context method as part of customizing the form template, and that method contains logic that causes the returned context to vary depending on the block value, this will no longer work as intended. This is because get_form_context is now invoked once with the block's default (blank) value in order to construct a template for the client-side rendering to use; previously it was called for each block in the stream. In the new implementation, any Python-side processing that needs to happen on a per-block-value basis can be performed in the block's get_form_state method; the data returned from that method will then be available in the client-side render method.
If FieldBlock is used to wrap a Django widget with non-standard client-side behaviour - such as requiring a JavaScript function to be called on initialisation, or combining multiple HTML elements such that it is not possible to read or write its data by accessing a single element's value property - then you will need to supply a JavaScript handler object to define how the widget is rendered and populated, and how to extract data from it.
Packages that replace the StreamField interface at a low level, such as wagtail-react-streamfield, are likely to be incompatible (but the new StreamField implementation will generally offer equivalent functionality).
For further details, see custom_streamfield_blocks.
Setting menu items now use SVG icons by default. For sites reusing built-in Wagtail icons, no changes should be required. For sites using custom font icons, update the menu items’ definition to use the classnames attribute:
# With register_setting,
# Before:
@register_setting(icon='custom-cog')
# After:
@register_setting(icon='', classnames='icon icon-custom-cog')
# Or with register_settings_menu_item,
@hooks.register('register_settings_menu_item')
def register_frank_menu_item():
# Before:
return SettingMenuItem(CustomSetting, icon='custom-cog')
# After:
return SettingMenuItem(CustomSetting, icon='', classnames='icon icon-custom-cog')
Page.settings_panels now includes CommentPanel, which is used to save and load comments. If you are overriding page settings edit handlers without directly extending Page.settings_panels (ie settings_panels = Page.settings_panels + [ FieldPanel('my_field') ] would need no change here) and want to use the new commenting system, your list of edit handlers should be updated to include CommentPanel. For example:
from django.db import models
from wagtail.core.models import Page
from wagtail.admin.edit_handlers import CommentPanel
class HomePage(Page):
settings_panels = [
# My existing panels here
CommentPanel(),
]
We would love to receive your feedback on this release.
New StreamField implementation with performance and functionality improvements (Matt Westcott, Karl Hobley)
wagtail.contrib.simple_translation (Coen van der Kamp)min_num, max_num and block_counts arguments directly to StreamField (Haydn Greatnews, Matt Westcott)__year lookup in Elasticsearch queries (Seb Brown)type(), not_type(), exact_type() and not_exact_type() methods on PageQuerySet (Andy Babic)Page.get_specific() and added the copy_attrs_exclude option (Andy Babic)PageQueryset.specific(defer=True) to only perform a single database query (Andy Babic)PageQueryset.defer_streamfields() (Andy Babic)PageQuerySet.defer_streamfields() to improve efficiency in a few key places (Andy Babic)register_setting, register_settings_menu_item to use SVG icons (Thibaud Colas)SearchArea subclasses in register_admin_search_area (Thibaud Colas)wagtail.reorder page audit log action (Storm Heg)get_settings template tag now supports specifying the variable name with {% get_settings as var %} (Samir Shah){% pageurl %} fallback to be a direct URL or an object with a get_absolute_url method (Andy Babic)blank keyword argument (Matt Westcott){% include_block with context %} now passes local variables into the block template (Jonny Scholes)New StreamField implementation with performance and functionality improvements (Matt Westcott, Karl Hobley)
wagtail.contrib.simple_translation (Coen van der Kamp)min_num, max_num and block_counts arguments directly to StreamField (Haydn Greatnews, Matt Westcott)__year lookup in Elasticsearch queries (Seb Brown)type(), not_type(), exact_type() and not_exact_type() methods on PageQuerySet (Andy Babic)Page.get_specific() and added the copy_attrs_exclude option (Andy Babic)PageQueryset.specific(defer=True) to only perform a single database query (Andy Babic)PageQueryset.defer_streamfields() (Andy Babic)PageQuerySet.defer_streamfields() to improve efficiency in a few key places (Andy Babic)register_setting, register_settings_menu_item to use SVG icons (Thibaud Colas)SearchArea subclasses in register_admin_search_area (Thibaud Colas)wagtail.reorder page audit log action (Storm Heg)get_settings template tag now supports specifying the variable name with {% get_settings as var %} (Samir Shah){% pageurl %} fallback to be a direct URL or an object with a get_absolute_url method (Andy Babic)blank keyword argument (Matt Westcott){% include_block with context %} now passes local variables into the block template (Jonny Scholes)New StreamField implementation with performance and functionality improvements (Matt Westcott, Karl Hobley)
wagtail.contrib.simple_translation (Coen van der Kamp)min_num, max_num and block_counts arguments directly to StreamField (Haydn Greatnews, Matt Westcott)__year lookup in Elasticsearch queries (Seb Brown)type(), not_type(), exact_type() and not_exact_type() methods on PageQuerySet (Andy Babic)Page.get_specific() and added the copy_attrs_exclude option (Andy Babic)PageQueryset.specific(defer=True) to only perform a single database query (Andy Babic)PageQueryset.defer_streamfields() (Andy Babic)PageQuerySet.defer_streamfields() to improve efficiency in a few key places (Andy Babic)register_setting, register_settings_menu_item to use SVG icons (Thibaud Colas)SearchArea subclasses in register_admin_search_area (Thibaud Colas)wagtail.reorder page audit log action (Storm Heg)get_settings template tag now supports specifying the variable name with {% get_settings as var %} (Samir Shah){% pageurl %} fallback to be a direct URL or an object with a get_absolute_url method (Andy Babic)blank keyword argument (Matt Westcott){% include_block with context %} now passes local variables into the block template (Jonny Scholes)Fix: Prevent embed thumbnail_url migration from failing on URLs longer than 200 characters (Matt Westcott)
July 13, 2021
Prevent embed thumbnail_url migration from failing on URLs longer than 200 characters (Matt Westcott)
CVE-2021-32681 - fix improper escaping of HTML ('Cross-site Scripting') in Wagtail StreamField blocks (Karen Tracey, Matt Westcott)
CVE-2021-32681 - fix improper escaping of HTML ('Cross-site Scripting') in Wagtail StreamField blocks (Karen Tracey, Matt Westcott)
June 17, 2021
This release addresses a cross-site scripting (XSS) vulnerability in StreamField. When the {% include_block %} template tag is used to output the value of a plain-text StreamField block (CharBlock, TextBlock or a similar user-defined block derived from FieldBlock), and that block does not specify a template for rendering, the tag output is not properly escaped as HTML. This could allow users to insert arbitrary HTML or scripting. This vulnerability is only exploitable by users with the ability to author StreamField content (i.e. users with 'editor' access to the Wagtail admin).
Site implementers who wish to retain the existing behaviour of allowing editors to insert HTML content in these blocks (and are willing to accept the risk of untrusted editors inserting arbitrary code) may disable the escaping by surrounding the relevant {% include_block %} tag in {% autoescape off %}...{% endautoescape %}.
Many thanks to Karen Tracey for reporting this issue. For further details, please see the CVE-2021-32681 security advisory.
Fix: CVE-2021-29434 - fix improper validation of URLs ('Cross-site Scripting') in rich text fields (Kevin Breen, Matt Westcott)
April 19, 2021
This release addresses a cross-site scripting (XSS) vulnerability in rich text fields. When saving the contents of a rich text field in the admin interface, Wagtail did not apply server-side checks to ensure that link URLs use a valid protocol. A malicious user with access to the admin interface could thus craft a POST request to publish content with javascript: URLs containing arbitrary code. The vulnerability is not exploitable by an ordinary site visitor without access to the Wagtail admin.
Many thanks to Kevin Breen for reporting this issue.
Prevent reverse migration errors in images and documents (Mike Brown)
Avoid wagtailembeds migration failure on MySQL 8.0.13+ (Matt Westcott)
One column per quarter.