# index.html.md # Welcome to Wagtail’s documentation Wagtail is an open source CMS written in [Python](https://www.python.org/) and built on the [Django web framework](https://www.djangoproject.com/). Below are some useful links to help you get started with Wagtail. If you’d like to get a quick feel for Wagtail, try spinning up a [temporary developer environment](https://gitpod.io/#https://github.com/wagtail/wagtail-gitpod) in your browser (running on Gitpod - here’s [how it works](https://wagtail.org/blog/gitpod/)). * **First steps** * [Getting started](getting_started/index.md) * [Your first Wagtail site](getting_started/tutorial.md) * [Demo site](getting_started/demo_site.md) * [Tutorial](tutorial/index.md) * **Using Wagtail** * [Page models](topics/pages.md) * [Writing templates](topics/writing_templates.md) * [How to use images in templates](topics/images.md) * [Search](topics/search/index.md) * [Snippets](topics/snippets/index.md) * [Third-party tutorials](advanced_topics/third_party_tutorials.md) * **For editors** * [Editors guide (separate site)](https://guide.wagtail.org/) ## Index * [Getting started](getting_started/index.md) * [Your first Wagtail site](getting_started/tutorial.md) * [Quick install](getting_started/quick_install.md) * [Demo site](getting_started/demo_site.md) * [Integrating Wagtail into a Django project](getting_started/integrating_into_django.md) * [The Zen of Wagtail](getting_started/the_zen_of_wagtail.md) * [Tutorial](tutorial/index.md) * [Customize your home page](tutorial/customize_homepage.md) * [Create a footer for all pages](tutorial/create_footer_for_all_pages.md) * [Create editable footer text with Wagtail Snippets](tutorial/create_footer_for_all_pages.md#create-editable-footer-text-with-wagtail-snippets) * [Set up site menu for linking to the homepage and other pages](tutorial/set_up_site_menu.md) * [Style and improve user experience](tutorial/style_your_site.md) * [Create contact page](tutorial/create_contact_page.md) * [Create a portfolio page](tutorial/create_portfolio_page.md) * [Add search to your site](tutorial/add_search.md) * [Deploy your site](tutorial/deployment.md) * [Usage guide](topics/index.md) * [Page models](topics/pages.md) * [Writing templates](topics/writing_templates.md) * [How to use images in templates](topics/images.md) * [Search](topics/search/index.md) * [Snippets](topics/snippets/index.md) * [How to use StreamField for mixed content](topics/streamfield.md) * [Permissions](topics/permissions.md) * [Advanced](advanced_topics/index.md) * [Images](advanced_topics/images/index.md) * [Documents](advanced_topics/documents/index.md) * [Icons](advanced_topics/icons.md) * [Embedded content](advanced_topics/embeds.md) * [Tagging](advanced_topics/tags.md) * [How to add Wagtail into an existing Django project](advanced_topics/add_to_django_project.md) * [Performance](advanced_topics/performance.md) * [Internationalization](advanced_topics/i18n.md) * [Private pages](advanced_topics/privacy.md) * [Customizing Wagtail](advanced_topics/customization/index.md) * [Third-party tutorials](advanced_topics/third_party_tutorials.md) * [Testing your Wagtail site](advanced_topics/testing.md) * [Wagtail API](advanced_topics/api/index.md) * [How to build a site with AMP support](advanced_topics/amp.md) * [Accessibility considerations](advanced_topics/accessibility_considerations.md) * [Sustainability considerations](advanced_topics/sustainability_considerations.md) * [About StreamField BoundBlocks and values](advanced_topics/boundblocks_and_values.md) * [Multi-site, multi-instance and multi-tenancy](advanced_topics/multi_site_multi_instance_multi_tenancy.md) * [How to use a redirect with Form builder to prevent double submission](advanced_topics/formbuilder_routablepage_redirect.md) * [StreamField migrations](advanced_topics/streamfield_migrations.md) * [StreamField validation](advanced_topics/streamfield_validation.md) * [Manage the reference index](advanced_topics/reference_index.md) * [Headless support](advanced_topics/headless.md) * [Extending](extending/index.md) * [Creating admin views](extending/admin_views.md) * [Generic views](extending/generic_views.md) * [Template components](extending/template_components.md) * [Using forms in admin views](extending/forms.md) * [Adding reports](extending/adding_reports.md) * [Adding new Task types](extending/custom_tasks.md) * [Audit log](extending/audit_log.md) * [Customizing the user account settings form](extending/custom_account_settings.md) * [Customizing group edit/create views](extending/customizing_group_views.md) * [Custom image filters](extending/custom_image_filters.md) * [Extending client-side behavior](extending/extending_client_side.md) * [Accessing the editor programmatically](extending/editor_api.md) * [Accessing panels from client-side code](extending/client_side_panels.md) * [Rich text internals](extending/rich_text_internals.md) * [Extending the Draftail editor](extending/extending_draftail.md) * [Adding custom bulk actions](extending/custom_bulk_actions.md) * [Reference](reference/index.md) * [Pages](reference/pages/index.md) * [StreamField reference](reference/streamfield/index.md) * [Contrib modules](reference/contrib/index.md) * [Admin UI reference](reference/ui/index.md) * [Management commands](reference/management_commands.md) * [Model reference](reference/models.md) * [Hooks](reference/hooks.md) * [Signals](reference/signals.md) * [Settings](reference/settings.md) * [The project template](reference/project_template.md) * [Jinja2 template support](reference/jinja2.md) * [Panels](reference/panels.md) * [Viewsets](reference/viewsets.md) * [Deployment & hosting](deployment/index.md) * [Support](support.md) * [Editor’s guide](editor_manual/index.md) * [Contributing](contributing/index.md) * [Your first contribution](contributing/first_contribution_guide.md) * [Setting up a development environment](contributing/developing.md) * [General coding guidelines](contributing/general_guidelines.md) * [Python coding guidelines](contributing/python_guidelines.md) * [UI coding guidelines](contributing/ui_guidelines.md) * [Documentation guidelines](contributing/documentation_guidelines.md) * [Writing documentation](contributing/documentation_modes.md) * [Translations](contributing/translations.md) * [Reporting security issues](contributing/security.md) * [Issue tracking](contributing/issue_tracking.md) * [Committing code](contributing/committing.md) * [Release notes](releases/index.md) * [Upgrading Wagtail](releases/upgrading.md) * [Wagtail’s release process](releases/release_process.md) * [Wagtail 7.4 (LTS) release notes](releases/7.4.md) * [Wagtail 7.3.1 release notes - IN DEVELOPMENT](releases/7.3.1.md) * [Wagtail 7.3 release notes](releases/7.3.md) * [Wagtail 7.2.2 release notes](releases/7.2.2.md) * [Wagtail 7.2.1 release notes](releases/7.2.1.md) * [Wagtail 7.2 release notes](releases/7.2.md) * [Wagtail 7.1.3 release notes](releases/7.1.3.md) * [Wagtail 7.1.2 release notes](releases/7.1.2.md) * [Wagtail 7.1.1 release notes](releases/7.1.1.md) * [Wagtail 7.1 release notes](releases/7.1.md) * [Wagtail 7.0.5 release notes](releases/7.0.5.md) * [Wagtail 7.0.4 release notes](releases/7.0.4.md) * [Wagtail 7.0.3 release notes](releases/7.0.3.md) * [Wagtail 7.0.2 release notes](releases/7.0.2.md) * [Wagtail 7.0.1 release notes](releases/7.0.1.md) * [Wagtail 7.0 (LTS) release notes](releases/7.0.md) * [Wagtail 6.4.2 release notes](releases/6.4.2.md) * [Wagtail 6.4.1 release notes](releases/6.4.1.md) * [Wagtail 6.4 release notes](releases/6.4.md) * [Wagtail 6.3.7 release notes](releases/6.3.7.md) * [Wagtail 6.3.6 release notes](releases/6.3.6.md) * [Wagtail 6.3.5 release notes](releases/6.3.5.md) * [Wagtail 6.3.4 release notes](releases/6.3.4.md) * [Wagtail 6.3.3 release notes](releases/6.3.3.md) * [Wagtail 6.3.2 release notes](releases/6.3.2.md) * [Wagtail 6.3.1 release notes](releases/6.3.1.md) * [Wagtail 6.3 (LTS) release notes](releases/6.3.md) * [Wagtail 6.2.4 release notes](releases/6.2.4.md) * [Wagtail 6.2.3 release notes](releases/6.2.3.md) * [Wagtail 6.2.2 release notes](releases/6.2.2.md) * [Wagtail 6.2.1 release notes](releases/6.2.1.md) * [Wagtail 6.2 release notes](releases/6.2.md) * [Wagtail 6.1.3 release notes](releases/6.1.3.md) * [Wagtail 6.1.2 release notes](releases/6.1.2.md) * [Wagtail 6.1.1 release notes](releases/6.1.1.md) * [Wagtail 6.1 release notes](releases/6.1.md) * [Wagtail 6.0.6 release notes](releases/6.0.6.md) * [Wagtail 6.0.5 release notes](releases/6.0.5.md) * [Wagtail 6.0.4 release notes](releases/6.0.4.md) * [Wagtail 6.0.3 release notes](releases/6.0.3.md) * [Wagtail 6.0.2 release notes](releases/6.0.2.md) * [Wagtail 6.0.1 release notes](releases/6.0.1.md) * [Wagtail 6.0 release notes](releases/6.0.md) * [Wagtail 5.2.8 release notes](releases/5.2.8.md) * [Wagtail 5.2.7 release notes](releases/5.2.7.md) * [Wagtail 5.2.6 release notes](releases/5.2.6.md) * [Wagtail 5.2.5 release notes](releases/5.2.5.md) * [Wagtail 5.2.4 release notes](releases/5.2.4.md) * [Wagtail 5.2.3 release notes](releases/5.2.3.md) * [Wagtail 5.2.2 release notes](releases/5.2.2.md) * [Wagtail 5.2.1 release notes](releases/5.2.1.md) * [Wagtail 5.2 (LTS) release notes](releases/5.2.md) * [Wagtail 5.1.3 release notes](releases/5.1.3.md) * [Wagtail 5.1.2 release notes](releases/5.1.2.md) * [Wagtail 5.1.1 release notes](releases/5.1.1.md) * [Wagtail 5.1 release notes](releases/5.1.md) * [Wagtail 5.0.5 release notes](releases/5.0.5.md) * [Wagtail 5.0.4 release notes](releases/5.0.4.md) * [Wagtail 5.0.3 release notes](releases/5.0.3.md) * [Wagtail 5.0.2 release notes](releases/5.0.2.md) * [Wagtail 5.0.1 release notes](releases/5.0.1.md) * [Wagtail 5.0 release notes](releases/5.0.md) * [Wagtail 4.2.4 release notes](releases/4.2.4.md) * [Wagtail 4.2.3 release notes](releases/4.2.3.md) * [Wagtail 4.2.2 release notes](releases/4.2.2.md) * [Wagtail 4.2.1 release notes](releases/4.2.1.md) * [Wagtail 4.2 release notes](releases/4.2.md) * [Wagtail 4.1.9 release notes](releases/4.1.9.md) * [Wagtail 4.1.8 release notes](releases/4.1.8.md) * [Wagtail 4.1.7 release notes](releases/4.1.7.md) * [Wagtail 4.1.6 release notes](releases/4.1.6.md) * [Wagtail 4.1.5 release notes](releases/4.1.5.md) * [Wagtail 4.1.4 release notes](releases/4.1.4.md) * [Wagtail 4.1.3 release notes](releases/4.1.3.md) * [Wagtail 4.1.2 release notes](releases/4.1.2.md) * [Wagtail 4.1.1 release notes](releases/4.1.1.md) * [Wagtail 4.1 (LTS) release notes](releases/4.1.md) * [Wagtail 4.0.4 release notes](releases/4.0.4.md) * [Wagtail 4.0.2 release notes](releases/4.0.2.md) * [Wagtail 4.0.1 release notes](releases/4.0.1.md) * [Wagtail 4.0 release notes](releases/4.0.md) * [Wagtail 3.0.3 release notes](releases/3.0.3.md) * [Wagtail 3.0.2 release notes](releases/3.0.2.md) * [Wagtail 3.0.1 release notes](releases/3.0.1.md) * [Wagtail 3.0 release notes](releases/3.0.md) * [Wagtail 2.16.3 release notes](releases/2.16.3.md) * [Wagtail 2.16.2 release notes](releases/2.16.2.md) * [Wagtail 2.16.1 release notes](releases/2.16.1.md) * [Wagtail 2.16 release notes](releases/2.16.md) * [Wagtail 2.15.6 release notes](releases/2.15.6.md) * [Wagtail 2.15.5 release notes](releases/2.15.5.md) * [Wagtail 2.15.4 release notes](releases/2.15.4.md) * [Wagtail 2.15.3 release notes](releases/2.15.3.md) * [Wagtail 2.15.2 release notes](releases/2.15.2.md) * [Wagtail 2.15.1 release notes](releases/2.15.1.md) * [Wagtail 2.15 (LTS) release notes](releases/2.15.md) * [Wagtail 2.14.2 release notes](releases/2.14.2.md) * [Wagtail 2.14.1 release notes](releases/2.14.1.md) * [Wagtail 2.14 release notes](releases/2.14.md) * [Wagtail 2.13.5 release notes](releases/2.13.5.md) * [Wagtail 2.13.4 release notes](releases/2.13.4.md) * [Wagtail 2.13.3 release notes](releases/2.13.3.md) * [Wagtail 2.13.2 release notes](releases/2.13.2.md) * [Wagtail 2.13.1 release notes](releases/2.13.1.md) * [Wagtail 2.13 release notes](releases/2.13.md) * [Wagtail 2.12.6 release notes](releases/2.12.6.md) * [Wagtail 2.12.5 release notes](releases/2.12.5.md) * [Wagtail 2.12.4 release notes](releases/2.12.4.md) * [Wagtail 2.12.3 release notes](releases/2.12.3.md) * [Wagtail 2.12.2 release notes](releases/2.12.2.md) * [Wagtail 2.12.1 release notes](releases/2.12.1.md) * [Wagtail 2.12 release notes](releases/2.12.md) * [Wagtail 2.11.9 release notes](releases/2.11.9.md) * [Wagtail 2.11.8 release notes](releases/2.11.8.md) * [Wagtail 2.11.7 release notes](releases/2.11.7.md) * [Wagtail 2.11.6 release notes](releases/2.11.6.md) * [Wagtail 2.11.5 release notes](releases/2.11.5.md) * [Wagtail 2.11.4 release notes](releases/2.11.4.md) * [Wagtail 2.11.3 release notes](releases/2.11.3.md) * [Wagtail 2.11.2 release notes](releases/2.11.2.md) * [Wagtail 2.11.1 release notes](releases/2.11.1.md) * [Wagtail 2.11 (LTS) release notes](releases/2.11.md) * [Wagtail 2.10.2 release notes](releases/2.10.2.md) * [Wagtail 2.10.1 release notes](releases/2.10.1.md) * [Wagtail 2.10 release notes](releases/2.10.md) * [Wagtail 2.9.3 release notes](releases/2.9.3.md) * [Wagtail 2.9.2 release notes](releases/2.9.2.md) * [Wagtail 2.9.1 release notes](releases/2.9.1.md) * [Wagtail 2.9 release notes](releases/2.9.md) * [Wagtail 2.8.2 release notes](releases/2.8.2.md) * [Wagtail 2.8.1 release notes](releases/2.8.1.md) * [Wagtail 2.8 release notes](releases/2.8.md) * [Wagtail 2.7.4 release notes](releases/2.7.4.md) * [Wagtail 2.7.3 release notes](releases/2.7.3.md) * [Wagtail 2.7.2 release notes](releases/2.7.2.md) * [Wagtail 2.7.1 release notes](releases/2.7.1.md) * [Wagtail 2.7 (LTS) release notes](releases/2.7.md) * [Wagtail 2.6.3 release notes](releases/2.6.3.md) * [Wagtail 2.6.2 release notes](releases/2.6.2.md) * [Wagtail 2.6.1 release notes](releases/2.6.1.md) * [Wagtail 2.6 release notes](releases/2.6.md) * [Wagtail 2.5.2 release notes](releases/2.5.2.md) * [Wagtail 2.5.1 release notes](releases/2.5.1.md) * [Wagtail 2.5 release notes](releases/2.5.md) * [Wagtail 2.4 release notes](releases/2.4.md) * [Wagtail 2.3 (LTS) release notes](releases/2.3.md) * [Wagtail 2.2.2 release notes](releases/2.2.2.md) * [Wagtail 2.2.1 release notes](releases/2.2.1.md) * [Wagtail 2.2 release notes](releases/2.2.md) * [Wagtail 2.1.3 release notes](releases/2.1.3.md) * [Wagtail 2.1.2 release notes](releases/2.1.2.md) * [Wagtail 2.1.1 release notes](releases/2.1.1.md) * [Wagtail 2.1 release notes](releases/2.1.md) * [Wagtail 2.0.2 release notes](releases/2.0.2.md) * [Wagtail 2.0.1 release notes](releases/2.0.1.md) * [Wagtail 2.0 release notes](releases/2.0.md) * [Wagtail 1.13.4 release notes](releases/1.13.4.md) * [Wagtail 1.13.3 release notes](releases/1.13.3.md) * [Wagtail 1.13.2 release notes](releases/1.13.2.md) * [Wagtail 1.13.1 release notes](releases/1.13.1.md) * [Wagtail 1.13 (LTS) release notes](releases/1.13.md) * [Wagtail 1.12.6 release notes](releases/1.12.6.md) * [Wagtail 1.12.5 release notes](releases/1.12.5.md) * [Wagtail 1.12.4 release notes](releases/1.12.4.md) * [Wagtail 1.12.3 release notes](releases/1.12.3.md) * [Wagtail 1.12.2 release notes](releases/1.12.2.md) * [Wagtail 1.12.1 release notes](releases/1.12.1.md) * [Wagtail 1.12 (LTS) release notes](releases/1.12.md) * [Wagtail 1.11.1 release notes](releases/1.11.1.md) * [Wagtail 1.11 release notes](releases/1.11.md) * [Wagtail 1.10.1 release notes](releases/1.10.1.md) * [Wagtail 1.10 release notes](releases/1.10.md) * [Wagtail 1.9.1 release notes](releases/1.9.1.md) * [Wagtail 1.9 release notes](releases/1.9.md) * [Wagtail 1.8.2 release notes](releases/1.8.2.md) * [Wagtail 1.8.1 release notes](releases/1.8.1.md) * [Wagtail 1.8 (LTS) release notes](releases/1.8.md) * [Wagtail 1.7 release notes](releases/1.7.md) * [Wagtail 1.6.3 release notes](releases/1.6.3.md) * [Wagtail 1.6.2 release notes](releases/1.6.2.md) * [Wagtail 1.6.1 release notes](releases/1.6.1.md) * [Wagtail 1.6 release notes](releases/1.6.md) * [Wagtail 1.5.3 release notes](releases/1.5.3.md) * [Wagtail 1.5.2 release notes](releases/1.5.2.md) * [Wagtail 1.5.1 release notes](releases/1.5.1.md) * [Wagtail 1.5 release notes](releases/1.5.md) * [Wagtail 1.4.6 release notes](releases/1.4.6.md) * [Wagtail 1.4.5 release notes](releases/1.4.5.md) * [Wagtail 1.4.4 release notes](releases/1.4.4.md) * [Wagtail 1.4.3 release notes](releases/1.4.3.md) * [Wagtail 1.4.2 release notes](releases/1.4.2.md) * [Wagtail 1.4.1 release notes](releases/1.4.1.md) * [Wagtail 1.4 (LTS) release notes](releases/1.4.md) * [Wagtail 1.3.1 release notes](releases/1.3.1.md) * [Wagtail 1.3 release notes](releases/1.3.md) * [Wagtail 1.2 release notes](releases/1.2.md) * [Wagtail 1.1 release notes](releases/1.1.md) * [Wagtail 1.0 release notes](releases/1.0.md) * [Wagtail 0.8.10 release notes](releases/0.8.10.md) * [Wagtail 0.8.8 release notes](releases/0.8.8.md) * [Wagtail 0.8.7 release notes](releases/0.8.7.md) * [Wagtail 0.8.6 release notes](releases/0.8.6.md) * [Wagtail 0.8.5 release notes](releases/0.8.5.md) * [Wagtail 0.8.4 release notes](releases/0.8.4.md) * [Wagtail 0.8.3 release notes](releases/0.8.3.md) * [Wagtail 0.8.1 release notes](releases/0.8.1.md) * [Wagtail 0.8 (LTS) release notes](releases/0.8.md) * [Wagtail 0.7 release notes](releases/0.7.md) * [Wagtail 0.6 release notes](releases/0.6.md) * [Wagtail 0.5 release notes](releases/0.5.md) * [Wagtail 0.4.1 release notes](releases/0.4.1.md) * [Wagtail 0.4 release notes](releases/0.4.md) # index.html.md # Editor’s guide Wagtail’s Editor Guide now has its own website: [guide.wagtail.org](https://guide.wagtail.org/). This guide is written for the users of a Wagtail-powered site. That is, the content editors, moderators and administrators who will be running things on a day-to-day basis. # index.html.md # Release notes * [Upgrading Wagtail](upgrading.md) * [Wagtail’s release process](release_process.md) * [Wagtail 7.4 (LTS) release notes](7.4.md) * [Wagtail 7.3.1 release notes - IN DEVELOPMENT](7.3.1.md) * [Wagtail 7.3 release notes](7.3.md) * [Wagtail 7.2.2 release notes](7.2.2.md) * [Wagtail 7.2.1 release notes](7.2.1.md) * [Wagtail 7.2 release notes](7.2.md) * [Wagtail 7.1.3 release notes](7.1.3.md) * [Wagtail 7.1.2 release notes](7.1.2.md) * [Wagtail 7.1.1 release notes](7.1.1.md) * [Wagtail 7.1 release notes](7.1.md) * [Wagtail 7.0.5 release notes](7.0.5.md) * [Wagtail 7.0.4 release notes](7.0.4.md) * [Wagtail 7.0.3 release notes](7.0.3.md) * [Wagtail 7.0.2 release notes](7.0.2.md) * [Wagtail 7.0.1 release notes](7.0.1.md) * [Wagtail 7.0 (LTS) release notes](7.0.md) * [Wagtail 6.4.2 release notes](6.4.2.md) * [Wagtail 6.4.1 release notes](6.4.1.md) * [Wagtail 6.4 release notes](6.4.md) * [Wagtail 6.3.7 release notes](6.3.7.md) * [Wagtail 6.3.6 release notes](6.3.6.md) * [Wagtail 6.3.5 release notes](6.3.5.md) * [Wagtail 6.3.4 release notes](6.3.4.md) * [Wagtail 6.3.3 release notes](6.3.3.md) * [Wagtail 6.3.2 release notes](6.3.2.md) * [Wagtail 6.3.1 release notes](6.3.1.md) * [Wagtail 6.3 (LTS) release notes](6.3.md) * [Wagtail 6.2.4 release notes](6.2.4.md) * [Wagtail 6.2.3 release notes](6.2.3.md) * [Wagtail 6.2.2 release notes](6.2.2.md) * [Wagtail 6.2.1 release notes](6.2.1.md) * [Wagtail 6.2 release notes](6.2.md) * [Wagtail 6.1.3 release notes](6.1.3.md) * [Wagtail 6.1.2 release notes](6.1.2.md) * [Wagtail 6.1.1 release notes](6.1.1.md) * [Wagtail 6.1 release notes](6.1.md) * [Wagtail 6.0.6 release notes](6.0.6.md) * [Wagtail 6.0.5 release notes](6.0.5.md) * [Wagtail 6.0.4 release notes](6.0.4.md) * [Wagtail 6.0.3 release notes](6.0.3.md) * [Wagtail 6.0.2 release notes](6.0.2.md) * [Wagtail 6.0.1 release notes](6.0.1.md) * [Wagtail 6.0 release notes](6.0.md) * [Wagtail 5.2.8 release notes](5.2.8.md) * [Wagtail 5.2.7 release notes](5.2.7.md) * [Wagtail 5.2.6 release notes](5.2.6.md) * [Wagtail 5.2.5 release notes](5.2.5.md) * [Wagtail 5.2.4 release notes](5.2.4.md) * [Wagtail 5.2.3 release notes](5.2.3.md) * [Wagtail 5.2.2 release notes](5.2.2.md) * [Wagtail 5.2.1 release notes](5.2.1.md) * [Wagtail 5.2 (LTS) release notes](5.2.md) * [Wagtail 5.1.3 release notes](5.1.3.md) * [Wagtail 5.1.2 release notes](5.1.2.md) * [Wagtail 5.1.1 release notes](5.1.1.md) * [Wagtail 5.1 release notes](5.1.md) * [Wagtail 5.0.5 release notes](5.0.5.md) * [Wagtail 5.0.4 release notes](5.0.4.md) * [Wagtail 5.0.3 release notes](5.0.3.md) * [Wagtail 5.0.2 release notes](5.0.2.md) * [Wagtail 5.0.1 release notes](5.0.1.md) * [Wagtail 5.0 release notes](5.0.md) * [Wagtail 4.2.4 release notes](4.2.4.md) * [Wagtail 4.2.3 release notes](4.2.3.md) * [Wagtail 4.2.2 release notes](4.2.2.md) * [Wagtail 4.2.1 release notes](4.2.1.md) * [Wagtail 4.2 release notes](4.2.md) * [Wagtail 4.1.9 release notes](4.1.9.md) * [Wagtail 4.1.8 release notes](4.1.8.md) * [Wagtail 4.1.7 release notes](4.1.7.md) * [Wagtail 4.1.6 release notes](4.1.6.md) * [Wagtail 4.1.5 release notes](4.1.5.md) * [Wagtail 4.1.4 release notes](4.1.4.md) * [Wagtail 4.1.3 release notes](4.1.3.md) * [Wagtail 4.1.2 release notes](4.1.2.md) * [Wagtail 4.1.1 release notes](4.1.1.md) * [Wagtail 4.1 (LTS) release notes](4.1.md) * [Wagtail 4.0.4 release notes](4.0.4.md) * [Wagtail 4.0.2 release notes](4.0.2.md) * [Wagtail 4.0.1 release notes](4.0.1.md) * [Wagtail 4.0 release notes](4.0.md) * [Wagtail 3.0.3 release notes](3.0.3.md) * [Wagtail 3.0.2 release notes](3.0.2.md) * [Wagtail 3.0.1 release notes](3.0.1.md) * [Wagtail 3.0 release notes](3.0.md) * [Wagtail 2.16.3 release notes](2.16.3.md) * [Wagtail 2.16.2 release notes](2.16.2.md) * [Wagtail 2.16.1 release notes](2.16.1.md) * [Wagtail 2.16 release notes](2.16.md) * [Wagtail 2.15.6 release notes](2.15.6.md) * [Wagtail 2.15.5 release notes](2.15.5.md) * [Wagtail 2.15.4 release notes](2.15.4.md) * [Wagtail 2.15.3 release notes](2.15.3.md) * [Wagtail 2.15.2 release notes](2.15.2.md) * [Wagtail 2.15.1 release notes](2.15.1.md) * [Wagtail 2.15 (LTS) release notes](2.15.md) * [Wagtail 2.14.2 release notes](2.14.2.md) * [Wagtail 2.14.1 release notes](2.14.1.md) * [Wagtail 2.14 release notes](2.14.md) * [Wagtail 2.13.5 release notes](2.13.5.md) * [Wagtail 2.13.4 release notes](2.13.4.md) * [Wagtail 2.13.3 release notes](2.13.3.md) * [Wagtail 2.13.2 release notes](2.13.2.md) * [Wagtail 2.13.1 release notes](2.13.1.md) * [Wagtail 2.13 release notes](2.13.md) * [Wagtail 2.12.6 release notes](2.12.6.md) * [Wagtail 2.12.5 release notes](2.12.5.md) * [Wagtail 2.12.4 release notes](2.12.4.md) * [Wagtail 2.12.3 release notes](2.12.3.md) * [Wagtail 2.12.2 release notes](2.12.2.md) * [Wagtail 2.12.1 release notes](2.12.1.md) * [Wagtail 2.12 release notes](2.12.md) * [Wagtail 2.11.9 release notes](2.11.9.md) * [Wagtail 2.11.8 release notes](2.11.8.md) * [Wagtail 2.11.7 release notes](2.11.7.md) * [Wagtail 2.11.6 release notes](2.11.6.md) * [Wagtail 2.11.5 release notes](2.11.5.md) * [Wagtail 2.11.4 release notes](2.11.4.md) * [Wagtail 2.11.3 release notes](2.11.3.md) * [Wagtail 2.11.2 release notes](2.11.2.md) * [Wagtail 2.11.1 release notes](2.11.1.md) * [Wagtail 2.11 (LTS) release notes](2.11.md) * [Wagtail 2.10.2 release notes](2.10.2.md) * [Wagtail 2.10.1 release notes](2.10.1.md) * [Wagtail 2.10 release notes](2.10.md) * [Wagtail 2.9.3 release notes](2.9.3.md) * [Wagtail 2.9.2 release notes](2.9.2.md) * [Wagtail 2.9.1 release notes](2.9.1.md) * [Wagtail 2.9 release notes](2.9.md) * [Wagtail 2.8.2 release notes](2.8.2.md) * [Wagtail 2.8.1 release notes](2.8.1.md) * [Wagtail 2.8 release notes](2.8.md) * [Wagtail 2.7.4 release notes](2.7.4.md) * [Wagtail 2.7.3 release notes](2.7.3.md) * [Wagtail 2.7.2 release notes](2.7.2.md) * [Wagtail 2.7.1 release notes](2.7.1.md) * [Wagtail 2.7 (LTS) release notes](2.7.md) * [Wagtail 2.6.3 release notes](2.6.3.md) * [Wagtail 2.6.2 release notes](2.6.2.md) * [Wagtail 2.6.1 release notes](2.6.1.md) * [Wagtail 2.6 release notes](2.6.md) * [Wagtail 2.5.2 release notes](2.5.2.md) * [Wagtail 2.5.1 release notes](2.5.1.md) * [Wagtail 2.5 release notes](2.5.md) * [Wagtail 2.4 release notes](2.4.md) * [Wagtail 2.3 (LTS) release notes](2.3.md) * [Wagtail 2.2.2 release notes](2.2.2.md) * [Wagtail 2.2.1 release notes](2.2.1.md) * [Wagtail 2.2 release notes](2.2.md) * [Wagtail 2.1.3 release notes](2.1.3.md) * [Wagtail 2.1.2 release notes](2.1.2.md) * [Wagtail 2.1.1 release notes](2.1.1.md) * [Wagtail 2.1 release notes](2.1.md) * [Wagtail 2.0.2 release notes](2.0.2.md) * [Wagtail 2.0.1 release notes](2.0.1.md) * [Wagtail 2.0 release notes](2.0.md) * [Wagtail 1.13.4 release notes](1.13.4.md) * [Wagtail 1.13.3 release notes](1.13.3.md) * [Wagtail 1.13.2 release notes](1.13.2.md) * [Wagtail 1.13.1 release notes](1.13.1.md) * [Wagtail 1.13 (LTS) release notes](1.13.md) * [Wagtail 1.12.6 release notes](1.12.6.md) * [Wagtail 1.12.5 release notes](1.12.5.md) * [Wagtail 1.12.4 release notes](1.12.4.md) * [Wagtail 1.12.3 release notes](1.12.3.md) * [Wagtail 1.12.2 release notes](1.12.2.md) * [Wagtail 1.12.1 release notes](1.12.1.md) * [Wagtail 1.12 (LTS) release notes](1.12.md) * [Wagtail 1.11.1 release notes](1.11.1.md) * [Wagtail 1.11 release notes](1.11.md) * [Wagtail 1.10.1 release notes](1.10.1.md) * [Wagtail 1.10 release notes](1.10.md) * [Wagtail 1.9.1 release notes](1.9.1.md) * [Wagtail 1.9 release notes](1.9.md) * [Wagtail 1.8.2 release notes](1.8.2.md) * [Wagtail 1.8.1 release notes](1.8.1.md) * [Wagtail 1.8 (LTS) release notes](1.8.md) * [Wagtail 1.7 release notes](1.7.md) * [Wagtail 1.6.3 release notes](1.6.3.md) * [Wagtail 1.6.2 release notes](1.6.2.md) * [Wagtail 1.6.1 release notes](1.6.1.md) * [Wagtail 1.6 release notes](1.6.md) * [Wagtail 1.5.3 release notes](1.5.3.md) * [Wagtail 1.5.2 release notes](1.5.2.md) * [Wagtail 1.5.1 release notes](1.5.1.md) * [Wagtail 1.5 release notes](1.5.md) * [Wagtail 1.4.6 release notes](1.4.6.md) * [Wagtail 1.4.5 release notes](1.4.5.md) * [Wagtail 1.4.4 release notes](1.4.4.md) * [Wagtail 1.4.3 release notes](1.4.3.md) * [Wagtail 1.4.2 release notes](1.4.2.md) * [Wagtail 1.4.1 release notes](1.4.1.md) * [Wagtail 1.4 (LTS) release notes](1.4.md) * [Wagtail 1.3.1 release notes](1.3.1.md) * [Wagtail 1.3 release notes](1.3.md) * [Wagtail 1.2 release notes](1.2.md) * [Wagtail 1.1 release notes](1.1.md) * [Wagtail 1.0 release notes](1.0.md) * [Wagtail 0.8.10 release notes](0.8.10.md) * [Wagtail 0.8.8 release notes](0.8.8.md) * [Wagtail 0.8.7 release notes](0.8.7.md) * [Wagtail 0.8.6 release notes](0.8.6.md) * [Wagtail 0.8.5 release notes](0.8.5.md) * [Wagtail 0.8.4 release notes](0.8.4.md) * [Wagtail 0.8.3 release notes](0.8.3.md) * [Wagtail 0.8.1 release notes](0.8.1.md) * [Wagtail 0.8 (LTS) release notes](0.8.md) * [Wagtail 0.7 release notes](0.7.md) * [Wagtail 0.6 release notes](0.6.md) * [Wagtail 0.5 release notes](0.5.md) * [Wagtail 0.4.1 release notes](0.4.1.md) * [Wagtail 0.4 release notes](0.4.md) # index.html.md # Usage guide * [Page models](pages.md) * [Writing templates](writing_templates.md) * [How to use images in templates](images.md) * [Search](search/index.md) * [Indexing](search/indexing.md) * [Searching](search/searching.md) * [Backends](search/backends.md) * [Snippets](snippets/index.md) * [Registering snippets](snippets/registering.md) * [Rendering snippets](snippets/rendering.md) * [Optional features](snippets/features.md) * [Customizing admin views for snippets](snippets/customizing.md) * [How to use StreamField for mixed content](streamfield.md) * [Permissions](permissions.md) # index.html.md # Search Wagtail provides a comprehensive and extensible search interface. In addition, it provides ways to promote search results through “Editor’s Picks”. Wagtail also collects simple statistics on queries made through the search interface. * [Indexing](indexing.md) * [Updating the index](indexing.md#updating-the-index) * [Indexing extra fields](indexing.md#indexing-extra-fields) * [Indexing custom models](indexing.md#indexing-custom-models) * [Searching](searching.md) * [Searching QuerySets](searching.md#searching-querysets) * [Changing search behavior](searching.md#changing-search-behavior) * [An example page search view](searching.md#an-example-page-search-view) * [Promoted search results](searching.md#promoted-search-results) * [Backends](backends.md) * [`AUTO_UPDATE`](backends.md#auto-update) * [`ATOMIC_REBUILD`](backends.md#atomic-rebuild) * [`BACKEND`](backends.md#backend) * [Rolling Your Own](backends.md#rolling-your-own) ## Indexing To make objects searchable, they must first be added to the search index. This involves configuring the models and fields that you would like to index (which is done for you for Pages, Images and Documents), and then actually inserting them into the index. See [Updating the index](indexing.md#wagtailsearch-indexing-update) for information on how to keep the objects in your search index in sync with the objects in your database. If you have created some extra fields in a subclass of `Page` or `Image`, you may want to add these new fields to the search index, so a user’s search query can match the Page or Image’s extra content. See [Indexing extra fields](indexing.md#wagtailsearch-indexing-fields). If you have a custom model which doesn’t derive from `Page` or `Image` that you would like to make searchable, see [Indexing custom models](indexing.md#wagtailsearch-indexing-models). ## Searching Wagtail provides an API for performing search queries on your models. You can also perform search queries on Django QuerySets. See [Searching](searching.md#wagtailsearch-searching). ## Backends Wagtail provides two backends for storing the search index and performing search queries: one using the database’s full-text search capabilities, and another using Elasticsearch. It’s also possible to roll your own search backend. See [Backends](backends.md#wagtailsearch-backends). # index.html.md # Snippets Snippets are pieces of content which do not necessitate a full webpage to render. They could be used for making secondary content, such as headers, footers, and sidebars, editable in the Wagtail admin. Snippets are Django models which do not inherit the [`Page`](../../reference/models.md#wagtail.models.Page) class and are thus not organised into the Wagtail tree. However, they can still be made editable by assigning panels and identifying the model as a snippet with the `register_snippet` class decorator or function. By default, snippets lack many of the features of pages, such as being orderable in the Wagtail admin or having a defined URL. Decide carefully if the content type you would want to build into a snippet might be more suited to a page. * [Registering snippets](registering.md) * [Using `@register_snippet` as a decorator](registering.md#using-register-snippet-as-a-decorator) * [Using `register_snippet` as a function](registering.md#using-register-snippet-as-a-function) * [Rendering snippets](rendering.md) * [Including snippets in template tags](rendering.md#including-snippets-in-template-tags) * [Binding pages to snippets](rendering.md#binding-pages-to-snippets) * [Optional features](features.md) * [Making snippets previewable](features.md#making-snippets-previewable) * [Making snippets searchable](features.md#making-snippets-searchable) * [Saving revisions of snippets](features.md#saving-revisions-of-snippets) * [Saving draft changes of snippets](features.md#saving-draft-changes-of-snippets) * [Locking snippets](features.md#locking-snippets) * [Enabling workflows for snippets](features.md#enabling-workflows-for-snippets) * [Tagging snippets](features.md#tagging-snippets) * [Inline models within snippets](features.md#inline-models-within-snippets) * [Customizing admin views for snippets](customizing.md) * [Icon](customizing.md#icon) * [URL namespace and base URL path](customizing.md#url-namespace-and-base-url-path) * [Listing view](customizing.md#listing-view) * [Copy view](customizing.md#copy-view) * [Inspect view](customizing.md#inspect-view) * [Templates](customizing.md#templates) * [Menu item](customizing.md#menu-item) # index.html.md # Advanced * [Images](images/index.md) * [Generating renditions in Python](images/renditions.md) * [Animated GIF support](images/animated_gifs.md) * [Image file formats](images/image_file_formats.md) * [Custom image models](images/custom_image_model.md) * [Changing rich text representation](images/changing_rich_text_representation.md) * [Feature detection](images/feature_detection.md) * [Dynamic image serve view](images/image_serve_view.md) * [Focal points](images/focal_points.md) * [Title generation on upload](images/title_generation_on_upload.md) * [Documents](documents/index.md) * [Documents overview](documents/overview.md) * [Custom document model](documents/custom_document_model.md) * [Custom document upload form](documents/custom_document_upload_form.md) * [Storing and serving](documents/storing_and_serving.md) * [Title generation on upload](documents/title_generation_on_upload.md) * [Testing documents](documents/testing.md) * [Icons](icons.md) * [Add a custom icon](icons.md#add-a-custom-icon) * [Icon template tag](icons.md#icon-template-tag) * [Changing icons via hooks](icons.md#changing-icons-via-hooks) * [Changing icons via template override](icons.md#changing-icons-via-template-override) * [Available icons](icons.md#available-icons) * [Embedded content](embeds.md) * [Embedding content on your site](embeds.md#embedding-content-on-your-site) * [Configuring embed “finders”](embeds.md#configuring-embed-finders) * [The `Embed` model](embeds.md#the-embed-model) * [Tagging](tags.md) * [Adding tags to a page model](tags.md#adding-tags-to-a-page-model) * [Custom tag models](tags.md#custom-tag-models) * [Disabling free tagging](tags.md#disabling-free-tagging) * [Managing tags as snippets](tags.md#managing-tags-as-snippets) * [How to add Wagtail into an existing Django project](add_to_django_project.md) * [Middleware (`settings.py`)](add_to_django_project.md#middleware-settings-py) * [Apps (`settings.py`)](add_to_django_project.md#apps-settings-py) * [URL Patterns](add_to_django_project.md#url-patterns) * [Ready to Use Example Configuration Files](add_to_django_project.md#ready-to-use-example-configuration-files) * [Performance](performance.md) * [Cache](performance.md#cache) * [Image URLs](performance.md#image-urls) * [Prefetch image rendition](performance.md#prefetch-image-rendition) * [Frontend caching proxy](performance.md#frontend-caching-proxy) * [Page URLs](performance.md#page-urls) * [Search](performance.md#search) * [Database](performance.md#database) * [Template fragment caching](performance.md#template-fragment-caching) * [Page cache key](performance.md#page-cache-key) * [Django](performance.md#django) * [Internationalization](i18n.md) * [Multi-language content](i18n.md#multi-language-content) * [Alternative internationalization approach: wagtail-modeltranslation](i18n.md#alternative-internationalization-approach-wagtail-modeltranslation) * [Wagtail admin translations](i18n.md#wagtail-admin-translations) * [Change Wagtail admin language on a per-user basis](i18n.md#change-wagtail-admin-language-on-a-per-user-basis) * [Changing the primary language of your Wagtail installation](i18n.md#changing-the-primary-language-of-your-wagtail-installation) * [Private pages](privacy.md) * [Private collections (restricting documents)](privacy.md#private-collections-restricting-documents) * [Setting up a login page](privacy.md#setting-up-a-login-page) * [Setting the default privacy restriction](privacy.md#setting-the-default-privacy-restriction) * [Setting up a global “password required” page](privacy.md#setting-up-a-global-password-required-page) * [Setting a “password required” page for a specific page type](privacy.md#setting-a-password-required-page-for-a-specific-page-type) * [Customizing Wagtail](customization/index.md) * [Customizing the editing interface](customization/page_editing_interface.md) * [Custom page listings](customization/custom_page_listings.md) * [Customizing admin templates](customization/admin_templates.md) * [Custom user models](customization/custom_user_models.md) * [How to build custom StreamField blocks](customization/streamfield_blocks.md) * [Third-party tutorials](third_party_tutorials.md) * [Tip](third_party_tutorials.md#tip) * [Testing your Wagtail site](testing.md) * [WagtailPageTestCase](testing.md#wagtailpagetestcase) * [Form data helpers](testing.md#module-wagtail.test.utils.form_data) * [Creating Page objects within tests](testing.md#creating-page-objects-within-tests) * [Fixtures](testing.md#fixtures) * [Wagtail API](api/index.md) * [Wagtail API v2 configuration guide](api/v2/configuration.md) * [Wagtail API v2 usage guide](api/v2/usage.md) * [How to set up Django Ninja](api/django-ninja.md) * [How to build a site with AMP support](amp.md) * [Overview](amp.md#overview) * [Creating the second page tree](amp.md#creating-the-second-page-tree) * [Making pages aware of “AMP mode”](amp.md#making-pages-aware-of-amp-mode) * [Write a template context processor so that AMP state can be checked in templates](amp.md#write-a-template-context-processor-so-that-amp-state-can-be-checked-in-templates) * [Using a different page template when AMP mode is active](amp.md#using-a-different-page-template-when-amp-mode-is-active) * [Overriding the `{% image %}` tag to output `` tags](amp.md#overriding-the-image-tag-to-output-amp-img-tags) * [Accessibility considerations](accessibility_considerations.md) * [Content modeling](accessibility_considerations.md#content-modeling) * [Accessibility in templates](accessibility_considerations.md#accessibility-in-templates) * [Authoring accessible content](accessibility_considerations.md#authoring-accessible-content) * [Accessibility resources](accessibility_considerations.md#id6) * [Sustainability considerations](sustainability_considerations.md) * [Standards](sustainability_considerations.md#standards) * [Guidelines](sustainability_considerations.md#guidelines) * [Quantifying emissions](sustainability_considerations.md#quantifying-emissions) * [About StreamField BoundBlocks and values](boundblocks_and_values.md) * [Multi-site, multi-instance and multi-tenancy](multi_site_multi_instance_multi_tenancy.md) * [Multi-site](multi_site_multi_instance_multi_tenancy.md#multi-site) * [Multi-instance](multi_site_multi_instance_multi_tenancy.md#multi-instance) * [Multi-tenancy](multi_site_multi_instance_multi_tenancy.md#multi-tenancy) * [How to use a redirect with Form builder to prevent double submission](formbuilder_routablepage_redirect.md) * [StreamField migrations](streamfield_migrations.md) * [Migrating RichTextFields to StreamField](streamfield_migrations.md#migrating-richtextfields-to-streamfield) * [StreamField data migrations](streamfield_migrations.md#streamfield-data-migrations) * [StreamField validation](streamfield_validation.md) * [Controlling where error messages are rendered](streamfield_validation.md#controlling-where-error-messages-are-rendered) * [Manage the reference index](reference_index.md) * [Configuration](reference_index.md#configuration) * [Maintenance](reference_index.md#maintenance) * [Guarantees and non-guarantees](reference_index.md#guarantees-and-non-guarantees) * [Using the ReferenceIndex API](reference_index.md#using-the-referenceindex-api) * [Enforcing stricter deletion rules](reference_index.md#enforcing-stricter-deletion-rules) * [Headless support](headless.md) * [API](headless.md#api) * [Functionality](headless.md#functionality) * [Frontend](headless.md#frontend) * [Supporting platforms](headless.md#supporting-platforms) * [Additional resources](headless.md#additional-resources) # index.html.md # Customizing Wagtail * [Customizing the editing interface](page_editing_interface.md) * [Customizing the tabbed interface](page_editing_interface.md#customizing-the-tabbed-interface) * [Rich Text (HTML)](page_editing_interface.md#rich-text-html) * [Date field validation](page_editing_interface.md#date-field-validation) * [Customizing generated forms](page_editing_interface.md#customizing-generated-forms) * [Customizing the generated copy page form](page_editing_interface.md#customizing-the-generated-copy-page-form) * [Customizing Page slug generation](page_editing_interface.md#customizing-page-slug-generation) * [Custom page listings](custom_page_listings.md) * [Customizing admin templates](admin_templates.md) * [Custom branding](admin_templates.md#custom-branding) * [Custom user profile avatar](admin_templates.md#custom-user-profile-avatar) * [Custom user interface fonts](admin_templates.md#custom-user-interface-fonts) * [Custom user interface colors](admin_templates.md#custom-user-interface-colors) * [Custom UI information density](admin_templates.md#custom-ui-information-density) * [Specifying a site or page in the branding](admin_templates.md#specifying-a-site-or-page-in-the-branding) * [Extending the login form](admin_templates.md#extending-the-login-form) * [Extending the password reset request form](admin_templates.md#extending-the-password-reset-request-form) * [Extending client-side JavaScript](admin_templates.md#extending-client-side-javascript) * [Custom user models](custom_user_models.md) * [Creating a custom user model](custom_user_models.md#creating-a-custom-user-model) * [Creating custom user forms](custom_user_models.md#creating-custom-user-forms) * [Extending the create and edit templates](custom_user_models.md#extending-the-create-and-edit-templates) * [Creating a custom `UserViewSet`](custom_user_models.md#creating-a-custom-userviewset) * [How to build custom StreamField blocks](streamfield_blocks.md) * [Custom editing interfaces for `StructBlock`](streamfield_blocks.md#custom-editing-interfaces-for-structblock) * [Additional JavaScript on `StructBlock` forms](streamfield_blocks.md#additional-javascript-on-structblock-forms) * [Additional methods and properties on `StructBlock` values](streamfield_blocks.md#additional-methods-and-properties-on-structblock-values) * [Custom block types](streamfield_blocks.md#custom-block-types) * [Handling block definitions within migrations](streamfield_blocks.md#handling-block-definitions-within-migrations) # index.html.md # Wagtail API Wagtail includes a built-in API module that provides a public-facing, JSON-formatted API to allow retrieving content as raw field data. This is useful for cases like serving content to non-web clients (such as a mobile phone app) or pulling content out of Wagtail for use in another site. See [RFC 8: Wagtail API](https://github.com/wagtail/rfcs/blob/main/text/008-wagtail-api.md#12---stable-and-unstable-versions) for full details on our stabilization policy. Wagtail is built on Django, so you can also use other Django solutions for building APIs such as [with Django Ninja](django-ninja.md#api-ninja) or [with GraphQL](https://github.com/torchbox/wagtail-grapple). * [Wagtail API v2 configuration guide](v2/configuration.md) * [Basic configuration](v2/configuration.md#basic-configuration) * [Additional settings](v2/configuration.md#additional-settings) * [Wagtail API v2 usage guide](v2/usage.md) * [Fetching content](v2/usage.md#fetching-content) * [Default endpoint fields](v2/usage.md#default-endpoint-fields) * [Changes since v1](v2/usage.md#changes-since-v1) * [How to set up Django Ninja](django-ninja.md) * [Basic configuration](django-ninja.md#basic-configuration) * [OpenAPI documentation](django-ninja.md#openapi-documentation) # index.html.md # Documents * [Documents overview](overview.md) * [Including `'wagtail.documents'` in `INSTALLED_APPS`](overview.md#including-wagtail-documents-in-installed-apps) * [Setting up URLs](overview.md#setting-up-urls) * [Using documents in a Page](overview.md#using-documents-in-a-page) * [Using documents within `RichTextFields`](overview.md#using-documents-within-richtextfields) * [Using documents within `StreamField`](overview.md#using-documents-within-streamfield) * [Working documents and collections](overview.md#working-documents-and-collections) * [Making documents private](overview.md#making-documents-private) * [API access](overview.md#api-access) * [Custom document model](custom_document_model.md) * [Referring to the document model](custom_document_model.md#module-wagtail.documents) * [Custom document upload form](custom_document_upload_form.md) * [Storing and serving](storing_and_serving.md) * [File storage location](storing_and_serving.md#file-storage-location) * [Serving documents](storing_and_serving.md#serving-documents) * [Content types](storing_and_serving.md#content-types) * [Inline content types](storing_and_serving.md#inline-content-types) * [File extensions](storing_and_serving.md#file-extensions) * [Document password required template](storing_and_serving.md#document-password-required-template) * [Title generation on upload](title_generation_on_upload.md) * [DOM event](title_generation_on_upload.md#dom-event) * [Code examples](title_generation_on_upload.md#code-examples) * [Testing documents](testing.md) * [Testing document upload forms](testing.md#testing-document-upload-forms) # index.html.md # Images * [Generating renditions in Python](renditions.md) * [Generating multiple renditions for an image](renditions.md#generating-multiple-renditions-for-an-image) * [Caching image renditions](renditions.md#caching-image-renditions) * [Prefetching image renditions](renditions.md#prefetching-image-renditions) * [Regenerating existing renditions](renditions.md#regenerating-existing-renditions) * [Model methods involved in rendition generation](renditions.md#model-methods-involved-in-rendition-generation) * [Animated GIF support](animated_gifs.md) * [Image file formats](image_file_formats.md) * [Using the picture element](image_file_formats.md#using-the-picture-element) * [Custom image models](custom_image_model.md) * [Migrating from the builtin image model](custom_image_model.md#migrating-from-the-builtin-image-model) * [Referring to the image model](custom_image_model.md#module-wagtail.images) * [Overriding the upload location](custom_image_model.md#overriding-the-upload-location) * [Changing rich text representation](changing_rich_text_representation.md) * [Feature detection](feature_detection.md) * [Installation](feature_detection.md#installation) * [Cropping](feature_detection.md#cropping) * [Switching on feature detection in Wagtail](feature_detection.md#switching-on-feature-detection-in-wagtail) * [Manually running feature detection](feature_detection.md#manually-running-feature-detection) * [Dynamic image serve view](image_serve_view.md) * [Setup](image_serve_view.md#setup) * [Usage](image_serve_view.md#usage) * [Advanced configuration](image_serve_view.md#advanced-configuration) * [Integration with django-sendfile](image_serve_view.md#integration-with-django-sendfile) * [Focal points](focal_points.md) * [Setting the `background-position` inline style based on the focal point](focal_points.md#setting-the-background-position-inline-style-based-on-the-focal-point) * [Accessing the focal point in templates](focal_points.md#accessing-the-focal-point-in-templates) * [Title generation on upload](title_generation_on_upload.md) * [DOM event](title_generation_on_upload.md#dom-event) * [Code examples](title_generation_on_upload.md#code-examples) # index.html.md # Reference * [Pages](pages/index.md) * [Theory](pages/theory.md) * [Recipes](pages/model_recipes.md) * [Page QuerySet reference](pages/queryset_reference.md) * [StreamField reference](streamfield/index.md) * [StreamField block reference](streamfield/blocks.md) * [Form widget client-side API](streamfield/widget_api.md) * [StreamField data migration reference](streamfield/data_migrations.md) * [Contrib modules](contrib/index.md) * [Settings models](contrib/settings.md) * [Form builder](contrib/forms/index.md) * [Sitemap generator](contrib/sitemaps.md) * [Frontend cache invalidator](contrib/frontendcache.md) * [`RoutablePageMixin`](contrib/routablepage.md) * [Promoted search results](contrib/searchpromotions.md) * [Simple translation](contrib/simple_translation.md) * [TableBlock](contrib/table_block.md) * [Typed table block](contrib/typed_table_block.md) * [Redirects](contrib/redirects.md) * [Legacy richtext](contrib/legacy_richtext.md) * [Admin UI reference](ui/index.md) * [UI components](ui/components.md) * [JavaScript components](ui/client.md) * [Management commands](management_commands.md) * [Model reference](models.md) * [Hooks](hooks.md) * [Signals](signals.md) * [Settings](settings.md) * [The project template](project_template.md) * [Jinja2 template support](jinja2.md) * [Panels](panels.md) * [Viewsets](viewsets.md) # index.html.md # Admin UI reference Wagtail includes a wide range of user interface (UI) components that are used to build the features within the CMS. These components are built using a combination of Django templates, [template components](../../extending/template_components.md#template-components), custom Python classes, and JavaScript. They start out as internal components, but they are designed with extensibility and reusability in mind. We acknowledge the usefulness of reusable components and their documentation for developers building custom features or third-party packages. While we strive to maintain a stable API for these components, we also need them to evolve rapidly to allow for continuous improvements to Wagtail’s user interface. We provide documentation for these components without making them subject to the same stability guarantees outlined in our deprecation policy. This means a component’s API may change in a minor release without going through the deprecation process. If you use these components in your own code, please ensure that you have a testing process in place to catch any breaking changes with each Wagtail upgrade. For more details, see our [Deprecation policy](../../releases/release_process.md#deprecation-policy). * [UI components](components.md) * [JavaScript components](client.md) # index.html.md # Contrib modules Wagtail ships with a variety of extra optional modules. * [Settings models](settings.md) * [Installation](settings.md#installation) * [Defining settings](settings.md#defining-settings) * [Edit handlers](settings.md#edit-handlers) * [Permissions](settings.md#permissions) * [Appearance](settings.md#appearance) * [Using the settings](settings.md#using-the-settings) * [Utilizing `select_related` to improve efficiency](settings.md#utilizing-select-related-to-improve-efficiency) * [Utilizing the `page_url` setting shortcut](settings.md#utilizing-the-page-url-setting-shortcut) * [Enabling previews for settings](settings.md#enabling-previews-for-settings) * [Form builder](forms/index.md) * [Usage](forms/index.md#usage) * [Displaying form submission information](forms/index.md#displaying-form-submission-information) * [Index](forms/index.md#index) * [Sitemap generator](sitemaps.md) * [Basic configuration](sitemaps.md#basic-configuration) * [Setting the hostname](sitemaps.md#setting-the-hostname) * [Customizing](sitemaps.md#customizing) * [Serving multiple sitemaps](sitemaps.md#serving-multiple-sitemaps) * [Frontend cache invalidator](frontendcache.md) * [Setting it up](frontendcache.md#setting-it-up) * [Multiple backends](frontendcache.md#multiple-backends) * [Advanced usage](frontendcache.md#advanced-usage) * [`RoutablePageMixin`](routablepage.md) * [Installation](routablepage.md#installation) * [The basics](routablepage.md#the-basics) * [The `RoutablePageMixin` class](routablepage.md#module-wagtail.contrib.routable_page.models) * [The `routablepageurl` template tag](routablepage.md#the-routablepageurl-template-tag) * [Promoted search results](searchpromotions.md) * [Installation](searchpromotions.md#installation) * [Usage](searchpromotions.md#usage) * [Management Commands](searchpromotions.md#management-commands) * [Simple translation](simple_translation.md) * [Basic configuration](simple_translation.md#basic-configuration) * [Page tree synchronization](simple_translation.md#page-tree-synchronization) * [TableBlock](table_block.md) * [Installation](table_block.md#installation) * [Basic Usage](table_block.md#basic-usage) * [Advanced Usage](table_block.md#advanced-usage) * [Typed table block](typed_table_block.md) * [Installation](typed_table_block.md#installation) * [Usage](typed_table_block.md#usage) * [Custom validation](typed_table_block.md#custom-validation) * [Redirects](redirects.md) * [Installation](redirects.md#installation) * [Usage](redirects.md#usage) * [Automatic redirect creation](redirects.md#automatic-redirect-creation) * [Management commands](redirects.md#management-commands) * [The `Redirect` class](redirects.md#module-wagtail.contrib.redirects.models) * [API](redirects.md#api) * [Legacy richtext](legacy_richtext.md) ## [Settings models](settings.md) Settings that are editable by administrators within the Wagtail admin - either site-specific or generic across all sites. ## [Form builder](forms/index.md) Allows forms to be created by admins and provides an interface for browsing form submissions. ## [Sitemap generator](sitemaps.md) Provides a view that generates a Google XML sitemap of your public Wagtail content. ## [Frontend cache invalidator](frontendcache.md) A module for automatically purging pages from a cache (Varnish, Squid, Cloudflare or CloudFront) when their content is changed. ## [RoutablePageMixin](routablepage.md) Provides a way of embedding Django URLconfs into pages. ## [Promoted search results](searchpromotions.md) A module for managing “Promoted Search Results” ## [Simple translation](simple_translation.md) A module for copying translatables (pages and snippets) to another language. ## [TableBlock](table_block.md) Provides a TableBlock for adding HTML tables to pages. ## [Typed table block](typed_table_block.md) Provides a StreamField block for authoring tables, where cells can be any block type including rich text. ## [Redirects](redirects.md) Provides a way to manage redirects. ## [Legacy richtext](legacy_richtext.md) Provides the legacy richtext wrapper (`
`). # index.html.md # Form builder The `wagtailforms` module allows you to set up single-page forms, such as a ‘Contact us’ form, as pages of a Wagtail site. It provides a set of base models that site implementers can extend to create their own `FormPage` type with their own site-specific templates. Once a page type has been set up in this way, editors can build forms within the usual page editor, consisting of any number of fields. Form submissions are stored for later retrieval through a new ‘Forms’ section within the Wagtail admin interface; in addition, they can be optionally e-mailed to an address specified by the editor. #### NOTE **wagtailforms is not a replacement for** [Django’s form support](https://docs.djangoproject.com/en/stable/topics/forms/). It is designed as a way for page authors to build general-purpose data collection forms without having to write code. If you intend to build a form that assigns specific behavior to individual fields (such as creating user accounts), or needs a custom HTML layout, you will almost certainly be better served by a standard Django form, where the fields are fixed in code rather than defined on-the-fly by a page author. See the [wagtail-form-example project](https://github.com/gasman/wagtail-form-example/commits/master) for an example of integrating a Django form into a Wagtail page. A number of third-party packages provide form builder capabilities using Wagtail’s [StreamField](../../../topics/streamfield.md#streamfield-topic) for greater flexibility - see [Wagtail Flexible Forms](https://docs.coderedcorp.com/wagtail-flexible-forms/index.html) and [Wagtail Form Plugins](https://github.com/laas/wagtail-form-plugins). ## Usage Add `wagtail.contrib.forms` to your `INSTALLED_APPS`: ```python INSTALLED_APPS = [ ... 'wagtail.contrib.forms', ] ``` Within the `models.py` of one of your apps, create a model that extends `wagtail.contrib.forms.models.AbstractEmailForm`: ```python from django.db import models from modelcluster.fields import ParentalKey from wagtail.admin.panels import ( FieldPanel, FieldRowPanel, InlinePanel, MultiFieldPanel ) from wagtail.fields import RichTextField from wagtail.contrib.forms.models import AbstractEmailForm, AbstractFormField class FormField(AbstractFormField): page = ParentalKey('FormPage', on_delete=models.CASCADE, related_name='form_fields') class FormPage(AbstractEmailForm): intro = RichTextField(blank=True) thank_you_text = RichTextField(blank=True) content_panels = AbstractEmailForm.content_panels + [ FieldPanel('intro'), InlinePanel('form_fields'), FieldPanel('thank_you_text'), MultiFieldPanel([ FieldRowPanel([ FieldPanel('from_address', classname="col6"), FieldPanel('to_address', classname="col6"), ]), FieldPanel('subject'), ], "Email"), ] ``` `AbstractEmailForm` defines the fields `to_address`, `from_address` and `subject`, and expects `form_fields` to be defined. Any additional fields are treated as ordinary page content - note that `FormPage` is responsible for serving both the form page itself and the landing page after submission, so the model definition should include all necessary content fields for both of those views. Date and datetime values in a form response will be formatted with the [`SHORT_DATE_FORMAT`](https://docs.djangoproject.com/en/stable/ref/settings/#std-setting-SHORT_DATE_FORMAT) and [`SHORT_DATETIME_FORMAT`](https://docs.djangoproject.com/en/stable/ref/settings/#std-setting-SHORT_DATETIME_FORMAT) respectively. (see [Custom render_email method](customization.md#form-builder-render-email) for how to customize the email content). If you do not want your form page type to offer form-to-email functionality, you can inherit from AbstractForm instead of `AbstractEmailForm`, and omit the `to_address`, `from_address`, and `subject` fields from the `content_panels` definition. You now need to create two templates named `form_page.html` and `form_page_landing.html` (where `form_page` is the underscore-formatted version of the class name). `form_page.html` differs from a standard Wagtail template in that it is passed a variable `form`, containing a Django `Form` object, in addition to the usual `page` variable. A very basic template for the form would thus be: ```html+django {% load wagtailcore_tags %} {{ page.title }}

{{ page.title }}

{{ page.intro|richtext }}
{% csrf_token %} {{ form.as_p }}
``` When submitted, this form will use both HTML5 client-side validation and Django server-side validation. To disable client-side validation for greater consistency between browsers, add the [`novalidate` form attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/form#novalidate) to the `
` tag. `form_page_landing.html` is a standard Wagtail template, displayed after the user makes a successful form submission, `form_submission` will be available in this template. If you want to dynamically override the landing page template, you can do so with the `get_landing_page_template` method (in the same way that you would with `get_template`). ## Displaying form submission information `FormSubmissionsPanel` can be added to your page’s panel definitions to display the number of form submissions and the time of the most recent submission, along with a quick link to access the full submission data: ```python from wagtail.contrib.forms.panels import FormSubmissionsPanel class FormPage(AbstractEmailForm): # ... content_panels = AbstractEmailForm.content_panels + [ FormSubmissionsPanel(), FieldPanel('intro'), # ... ] ``` ## Index * [Form builder customization](customization.md) # index.html.md # Pages Wagtail requires a little careful setup to define the types of content that you want to present through your website. The basic unit of content in Wagtail is the [`Page`](../models.md#wagtail.models.Page), and all of your page-level content will inherit basic webpage-related properties from it. But for the most part, you will be defining content yourself, through the construction of Django models using Wagtail’s `Page` as a base. Wagtail organizes content created from your models in a tree, which can have any structure and combination of model objects in it. Wagtail doesn’t prescribe ways to organize and interrelate your content, but here we’ve sketched out some strategies for organizing your models. The presentation of your content, the actual webpages, includes the normal use of the Django template system. We’ll cover additional functionality that Wagtail provides at the template level later on. * [Theory](theory.md) * [Introduction to trees](theory.md#introduction-to-trees) * [Anatomy of a Wagtail request](theory.md#anatomy-of-a-wagtail-request) * [Scheduled publishing](theory.md#scheduled-publishing) * [Scheduled unpublishing](theory.md#scheduled-unpublishing) * [Recipes](model_recipes.md) * [Overriding the `serve()` Method](model_recipes.md#overriding-the-serve-method) * [Adding Endpoints with Custom `route()` Methods](model_recipes.md#adding-endpoints-with-custom-route-methods) * [Page QuerySet reference](queryset_reference.md) * [Examples](queryset_reference.md#examples) * [Reference](queryset_reference.md#module-wagtail.query) # index.html.md # StreamField reference * [StreamField block reference](blocks.md) * [`wagtail.fields.StreamField`](blocks.md#wagtail.fields.StreamField) * [Block options and methods](blocks.md#block-options-and-methods) * [Field block types](blocks.md#field-block-types) * [Structural block types](blocks.md#structural-block-types) * [Supporting components](blocks.md#supporting-components) * [Form widget client-side API](widget_api.md) * [`render()`](widget_api.md#render) * [`getByName()`](widget_api.md#getByName) * [`idForLabel`](widget_api.md#idForLabel) * [`getValue()`](widget_api.md#getValue) * [`getState()`](widget_api.md#getState) * [`setState()`](widget_api.md#setState) * [`focus()`](widget_api.md#focus) * [StreamField data migration reference](data_migrations.md) * [wagtail.blocks.migrations.migrate_operation](data_migrations.md#wagtail-blocks-migrations-migrate-operation) * [wagtail.blocks.migrations.operations](data_migrations.md#wagtail-blocks-migrations-operations) * [wagtail.blocks.migrations.utils](data_migrations.md#wagtail-blocks-migrations-utils) * [Block paths](data_migrations.md#block-paths) ## [StreamField block reference](blocks.md#streamfield-block-reference) Details the block types provided by Wagtail for use in StreamField and how they can be combined into new block types. ## [Form widget client-side API](widget_api.md#streamfield-widget-api) Defines the JavaScript API that must be implemented for any form widget used within a StreamField block. ## [StreamField data migration reference](data_migrations.md#streamfield-data-migration-reference) Details the tools provided in `wagtail.blocks.migrations` for `StreamField` data migrations. # index.html.md # Getting started * [Your first Wagtail site](tutorial.md) * [Quick install](quick_install.md) * [Demo site](demo_site.md) * [Integrating Wagtail into a Django project](integrating_into_django.md) * [The Zen of Wagtail](the_zen_of_wagtail.md) Wagtail is an open-source content management system (CMS) that’s built on [Django](https://www.djangoproject.com/), a popular Python web framework. It has gained popularity among developers and content editors for its powerful features and intuitive interface, providing a streamlined editing experience. Wagtail offers a comprehensive toolkit for content creation and management, including a rich text editor with formatting options, image and document management, version control, workflows, and content scheduling. Developers appreciate Wagtail’s highly customizable and modular architecture, which includes built-in support for Django’s app structure. This allows them to easily create and integrate custom functionality, making Wagtail suitable for projects of any size. Wagtail excels in handling complex content structures, offering features like hierarchical page organization, robust search capabilities, and content localization. Wagtail stands out as the preferred choice for tens of thousands of organizations globally, including renowned names like Google, the National Aeronautics and Space Administration (NASA), and the British National Health Service (NHS). It has proven scalability and is capable of handling high volumes of traffic from millions of visitors every month. What sets Wagtail apart is its ability to extend beyond traditional content management, providing seamless integration with data tools and rich data visualizations. For more information about Wagtail and the guiding principles for building websites with it, read [The Zen of Wagtail](the_zen_of_wagtail.md). # index.html.md # Deployment & hosting Once you’ve built your Wagtail site, it’s time to release it upon the rest of the internet. Wagtail is built on Django, and so the vast majority of the deployment steps and considerations for deploying Django are also true for Wagtail. We recommend choosing one of the hosting providers listed below. ## Choosing a Hosting Provider Several hosting providers offer varying levels of support for Wagtail. We’ve organized them into three categories: - Wagtail-level support (easiest deployment). - Python-level support (requires some knowledge of WSGI and file storage). - Infrastructure-level support (requires knowledge of Linux). ## Wagtail-Level Support These hosting providers offer first-class support for Wagtail deployments and installations, designed to make it as easy as possible to run a Wagtail site. ### [CodeRed Cloud](https://www.codered.cloud/) - Website & pricing: [codered.cloud](https://www.codered.cloud/) - Wagtail deployment guide: [CodeRed Wagtail Quickstart](https://www.codered.cloud/docs/wagtail/quickstart/) - From the vendor: > CodeRed Cloud is inspired by simplicity and “it just works” philosophy. No special packages or 3rd party services required! Free plans are available, and every plan includes a database, media hosting, daily backups, and more. ### [Divio](https://www.divio.com/) - Website & pricing: [divio.com](https://www.divio.com/pricing/) - Wagtail deployment guide: [Divio Wagtail Setup Guide](https://docs.divio.com/introduction/wagtail/) - From the vendor: > Divio is a cloud hosting platform designed to simplify the development and deployment of containerized web applications. It integrates smoothly with Wagtail, providing developers with tools to efficiently manage web applications. Divio proactively manages and supports state-of-the-art cloud services, ensuring that your Wagtail applications are scalable, secure, and reliable. The platform’s user-friendly interface makes it easy to develop, deploy, manage, and maintain your web applications. With features like automated backups and staging environments, Divio handles the technical infrastructure, allowing you to focus on building and maintaining your Wagtail sites with confidence. ## Python-Level Support These hosting providers offer Python environments as a service. Usually, you will need to configure a WSGI server, file storage for media hosting, and a database. ### Fly.io with Backblaze Read our guide on [deploying to Fly.io](flyio.md). ## Infrastructure-Level Support These hosting providers offer the tools needed to run a Linux server, database, file storage, etc. Popular infrastructure providers include: **AWS, Azure, Digital Ocean, Google Cloud, and Linode**. ## Others Some examples of deployments on a few hosting platforms can be found in [Third-party tutorials](../advanced_topics/third_party_tutorials.md). This is not a complete list of platforms where Wagtail can run, nor is it necessarily the only way to run Wagtail there. For a technical deep-dive into the many aspects of Wagtail hosting, see [Deployment: Under the hood](under_the_hood.md). --- *Are you a hosting provider who supports Wagtail, and want to add yourself to this list? See if you meet our [requirements for hosting providers](https://github.com/wagtail/wagtail/wiki/Wagtail-Hosting-Providers).* # index.html.md # Contributing Thank you for your interest in improving Wagtail! ## First-time contributors 1. Read this document first. 2. We don’t assign tasks. Feel free to pick any issue/task that isn’t already being worked on by someone else. 3. Read the [Your first contribution guide](first_contribution_guide.md). ## Issues The easiest way to contribute to Wagtail is to tell us how to improve it! First, check to see if your bug or feature request has already been submitted at [github.com/wagtail/wagtail/issues](https://github.com/wagtail/wagtail/issues). If it has, and you have some supporting information that may help us deal with it, comment on the existing issue. If not, please [create a new one](https://github.com/wagtail/wagtail/issues/new), providing as much relevant context as possible. For example, if you’re experiencing problems with installation, detail your environment and the steps you’ve already taken. If something isn’t displaying correctly, tell us what browser you’re using, and include a screenshot if possible. If your bug report is a security issue, **do not** report it with an issue. Please read our guide to [reporting security issues](security.md). Please do not use the issue tracker for support queries - use [the ‘wagtail’ tag on Stack Overflow](https://stackoverflow.com/questions/tagged/wagtail) (preferred) or the [#support channel](https://github.com/wagtail/wagtail/wiki/Slack#support) on the [Wagtail Slack](https://github.com/wagtail/wagtail/wiki/Slack). If you’d like to discuss an idea before requesting it, use the [Wagtail Slack](https://github.com/wagtail/wagtail/wiki/Slack) or [Discussions](https://github.com/wagtail/wagtail/discussions). For further information about how issues are handled, see [Issue tracking](issue_tracking.md). ## Pull requests If you are just getting started with development and have never contributed to an open-source project, we recommend you read the [Your first contribution guide](first_contribution_guide.md). If you’re a confident Python or Django developer, [fork it](https://github.com/wagtail/wagtail/) and read the [developing docs](developing.md#developing-for-wagtail) to get stuck in! We welcome all contributions, whether they solve problems that are specific to you or they address existing issues. If you’re stuck for ideas, pick something from the [issue list](https://github.com/wagtail/wagtail/issues?q=is%3Aopen) - you might like to start by checking issues with the [good first issue](https://github.com/wagtail/wagtail/labels/good%20first%20issue) label. There is no need to ask “please assign me this issue”, but feel free to leave a comment outlining your plans so that other people know you’re working on it. For large-scale changes, we’d generally recommend breaking them down into smaller pull requests that achieve a single well-defined task and can be reviewed individually. If this isn’t possible, we recommend opening a pull request on the [Wagtail RFCs](https://github.com/wagtail/rfcs/) repository, so that there’s a chance for the community to discuss the change before it gets implemented. ## Translations Wagtail has internationalization support so if you are fluent in a non-English language you can contribute by localizing the interface. Translation work should be submitted through [Transifex](https://explore.transifex.com/torchbox/wagtail/). For information on how to get started see [Translations](translations.md#contributing-translations). ## Code reviews We welcome code reviews from everyone, although a core team member will need to do at least one review for the pull request to be merged. There’s always a list of pull requests tagged [status:Needs Review](https://github.com/wagtail/wagtail/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc+label%3A%22status%3ANeeds+Review%22). ## Triaging issues We welcome help with triaging issues and pull requests. You can help by: - Adding more details or your own perspective to bug reports or feature requests. - Attempting to reproduce issues tagged [status:Unconfirmed](https://github.com/wagtail/wagtail/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3Astatus%3AUnconfirmed) and sharing your findings. - Reviewing or otherwise offering your feedback on pull requests. View our [issue tracking guidelines](issue_tracking.md) for more information. ## Accessibility testing We’d love to get feedback on the accessibility of Wagtail. Get in touch with our [accessibility team](https://github.com/wagtail/wagtail/wiki/Accessibility-team) if you are testing Wagtail and want to report your findings, or have a look at our [backlog of accessibility issues and improvements](https://github.com/wagtail/wagtail/projects/5). We also document our [testing targets and known issues](ui_guidelines.md#accessibility-targets). ## Other contributions There are many more ways to contribute to the Wagtail community, through code or otherwise: - Contribute to one of the other [core Wagtail projects](https://github.com/orgs/wagtail/repositories) in GitHub. - Contribute to one of the community-maintained packages on [Wagtail Nest](https://github.com/wagtail-nest/). - Contribute user-facing documentation (including translations) on the [Wagtail guide](https://guide.wagtail.org/en-latest/contributing/). - Star the [wagtail](https://github.com/wagtail/wagtail) project on GitHub - Support others with answers to questions on the [Wagtail StackOverflow topic](https://stackoverflow.com/questions/tagged/wagtail) or in Slack `#support`. - Write a review of [Wagtail on G2](https://www.g2.com/products/wagtail/reviews). - Provide some thoughtful feedback on the [Wagtail discussions](https://github.com/wagtail/wagtail/discussions). - Submit (or write) a tutorial or great package to the [This Week in Wagtail newsletter](https://wagtail.org/newsletter/), [Awesome Wagtail](https://github.com/springload/awesome-wagtail) or [Third-party tutorials](../advanced_topics/third_party_tutorials.md). ## Developing packages for Wagtail If you are developing packages for Wagtail, you can add the following [PyPI](https://pypi.org/) classifiers: - [`Framework :: Wagtail`](https://pypi.org/search/?c=Framework+%3A%3A+Wagtail) - [`Framework :: Wagtail :: 1`](https://pypi.org/search/?c=Framework+%3A%3A+Wagtail+%3A%3A+1) - [`Framework :: Wagtail :: 2`](https://pypi.org/search/?c=Framework+%3A%3A+Wagtail+%3A%3A+2) - [`Framework :: Wagtail :: 3`](https://pypi.org/search/?c=Framework+%3A%3A+Wagtail+%3A%3A+3) - [`Framework :: Wagtail :: 4`](https://pypi.org/search/?c=Framework+%3A%3A+Wagtail+%3A%3A+4) - [`Framework :: Wagtail :: 5`](https://pypi.org/search/?c=Framework+%3A%3A+Wagtail+%3A%3A+5) - [`Framework :: Wagtail :: 6`](https://pypi.org/search/?c=Framework+%3A%3A+Wagtail+%3A%3A+6) You can also find a curated list of awesome packages, articles, and other cool resources from the Wagtail community at [Awesome Wagtail](https://github.com/springload/awesome-wagtail). ## More information * [Your first contribution](first_contribution_guide.md) * [Guide](first_contribution_guide.md#guide) * [Common questions](first_contribution_guide.md#common-questions) * [Helpful links](first_contribution_guide.md#helpful-links) * [Setting up a development environment](developing.md) * [Setting up the Wagtail codebase](developing.md#setting-up-the-wagtail-codebase) * [Development on Windows](developing.md#development-on-windows) * [Testing](developing.md#testing) * [Compiling static assets](developing.md#compiling-static-assets) * [Compiling the documentation](developing.md#compiling-the-documentation) * [Linting and formatting](developing.md#linting-and-formatting) * [Using forks for installation](developing.md#using-forks-for-installation) * [General coding guidelines](general_guidelines.md) * [Use of generative AI](general_guidelines.md#use-of-generative-ai) * [Language](general_guidelines.md#language) * [File names](general_guidelines.md#file-names) * [Naming conventions](general_guidelines.md#naming-conventions) * [Python coding guidelines](python_guidelines.md) * [PEP8](python_guidelines.md#pep8) * [Django compatibility](python_guidelines.md#django-compatibility) * [Tests](python_guidelines.md#tests) * [UI coding guidelines](ui_guidelines.md) * [Browser and device support](ui_guidelines.md#browser-and-device-support) * [Accessibility targets](ui_guidelines.md#accessibility-targets) * [HTML guidelines](ui_guidelines.md#html-guidelines) * [CSS guidelines](ui_guidelines.md#css-guidelines) * [JavaScript guidelines](ui_guidelines.md#javascript-guidelines) * [Stimulus](ui_guidelines.md#stimulus) * [Multilingual support](ui_guidelines.md#multilingual-support) * [Icons](ui_guidelines.md#icons) * [Images](ui_guidelines.md#images) * [UI Styleguide](ui_guidelines.md#ui-styleguide) * [Using the pattern library](ui_guidelines.md#using-the-pattern-library) * [Documentation guidelines](documentation_guidelines.md) * [Writing style guide](documentation_guidelines.md#writing-style-guide) * [Formatting recommendations](documentation_guidelines.md#formatting-recommendations) * [Formatting to avoid](documentation_guidelines.md#formatting-to-avoid) * [Code example considerations](documentation_guidelines.md#code-example-considerations) * [Writing documentation](documentation_modes.md) * [Choose a writing mode](documentation_modes.md#choose-a-writing-mode) * [Tutorial](documentation_modes.md#tutorial) * [How-to guide](documentation_modes.md#how-to-guide) * [Reference](documentation_modes.md#reference) * [Explanation](documentation_modes.md#explanation) * [Translations](translations.md) * [Translation workflow](translations.md#translation-workflow) * [Marking strings for translation](translations.md#marking-strings-for-translation) * [Additional resources](translations.md#additional-resources) * [Reporting security issues](security.md) * [Early notification](security.md#early-notification) * [Supported versions](security.md#supported-versions) * [Bug Bounties](security.md#bug-bounties) * [CVE IDs](security.md#cve-ids) * [How Wagtail discloses security issues](security.md#how-wagtail-discloses-security-issues) * [Frequently-reported issues](security.md#frequently-reported-issues) * [Issue tracking](issue_tracking.md) * [Issues](issue_tracking.md#issues) * [Pull requests](issue_tracking.md#pull-requests) * [Release schedule](issue_tracking.md#release-schedule) * [Committing code](committing.md) * [Check out the code locally](committing.md#check-out-the-code-locally) * [Rebase onto `main`](committing.md#rebase-onto-main) * [Update `CHANGELOG.txt` and release notes](committing.md#update-changelog-txt-and-release-notes) * [Push to `main`](committing.md#push-to-main) * [When you have made a mistake](committing.md#when-you-have-made-a-mistake) * [Add commits to someone else’s pull request](committing.md#add-commits-to-someone-else-s-pull-request) # index.html.md # Extending The Wagtail admin interface is a suite of Django apps, and so the familiar concepts from Django development - views, templates, URL routes and so on - can be used to add new functionality to Wagtail. Numerous [third-party packages](https://wagtail.org/packages/) can be installed to extend Wagtail’s capabilities. This section describes the various mechanisms that can be used to integrate your own code into Wagtail’s admin interface. #### NOTE The features described in this section and their corresponding reference documentation are not subject to the same level of stability described in our [Deprecation policy](../releases/release_process.md#deprecation-policy). Any backwards-incompatible changes to these features will be called out in the upgrade considerations of the [Release notes](../releases/index.md). * [Creating admin views](admin_views.md) * [Defining a view](admin_views.md#defining-a-view) * [Registering a URL route](admin_views.md#registering-a-url-route) * [Adding a template](admin_views.md#adding-a-template) * [Adding a menu item](admin_views.md#adding-a-menu-item) * [Adding a group of menu items](admin_views.md#adding-a-group-of-menu-items) * [Using `ViewSet` to group custom admin views](admin_views.md#using-viewset-to-group-custom-admin-views) * [Combining multiple `ViewSet`s using a `ViewSetGroup`](admin_views.md#combining-multiple-viewsets-using-a-viewsetgroup) * [Adding links in admin views](admin_views.md#adding-links-in-admin-views) * [Generic views](generic_views.md) * [ModelViewSet](generic_views.md#modelviewset) * [ChooserViewSet](generic_views.md#chooserviewset) * [Template components](template_components.md) * [`render_html()`](template_components.md#render_html) * [`media`](template_components.md#media) * [Creating components](template_components.md#creating-components) * [Passing context to the template](template_components.md#passing-context-to-the-template) * [Adding media definitions](template_components.md#adding-media-definitions) * [Using components on your own templates](template_components.md#using-components-on-your-own-templates) * [Using forms in admin views](forms.md) * [Defining admin form widgets](forms.md#defining-admin-form-widgets) * [Panels](forms.md#panels) * [Adding reports](adding_reports.md) * [Reporting reference](adding_reports.md#reporting-reference) * [Example report for pages with unpublished changes](adding_reports.md#example-report-for-pages-with-unpublished-changes) * [Adding new Task types](custom_tasks.md) * [Task models](custom_tasks.md#task-models) * [Custom TaskState models](custom_tasks.md#custom-taskstate-models) * [Customizing behavior](custom_tasks.md#customizing-behavior) * [Adding notifications](custom_tasks.md#adding-notifications) * [Audit log](audit_log.md) * [`log()`](audit_log.md#log) * [Log actions provided by Wagtail](audit_log.md#log-actions-provided-by-wagtail) * [Log context](audit_log.md#log-context) * [Log models](audit_log.md#log-models) * [Customizing the user account settings form](custom_account_settings.md) * [Adding new panels](custom_account_settings.md#adding-new-panels) * [Operating on the `UserProfile` model](custom_account_settings.md#operating-on-the-userprofile-model) * [Creating new tabs](custom_account_settings.md#creating-new-tabs) * [Customizing the template](custom_account_settings.md#customizing-the-template) * [Customizing group edit/create views](customizing_group_views.md) * [Custom edit/create forms](customizing_group_views.md#custom-edit-create-forms) * [Customizing the group editor permissions ordering](customizing_group_views.md#customizing-the-group-editor-permissions-ordering) * [Custom image filters](custom_image_filters.md) * [Extending client-side behavior](extending_client_side.md) * [Adding custom JavaScript](extending_client_side.md#adding-custom-javascript) * [Extending with DOM events](extending_client_side.md#extending-with-dom-events) * [Extending with Stimulus](extending_client_side.md#extending-with-stimulus) * [Extending with React](extending_client_side.md#extending-with-react) * [Extending Draftail](extending_client_side.md#extending-draftail) * [Extending StreamField](extending_client_side.md#extending-streamfield) * [Extending the editor](extending_client_side.md#extending-the-editor) * [Accessing the editor programmatically](editor_api.md) * [The editor’s `` element](editor_api.md#the-editor-s-form-element) * [The preview panel](editor_api.md#the-preview-panel) * [Example: generating meta description](editor_api.md#example-generating-meta-description) * [Accessing panels from client-side code](client_side_panels.md) * [`Panel`](client_side_panels.md#panel) * [`PanelGroup`](client_side_panels.md#panelgroup) * [`FieldPanel`](client_side_panels.md#fieldpanel) * [`InlinePanel`](client_side_panels.md#inlinepanel) * [Rich text internals](rich_text_internals.md) * [Data format](rich_text_internals.md#data-format) * [The feature registry](rich_text_internals.md#the-feature-registry) * [Rewrite handlers](rich_text_internals.md#rewrite-handlers) * [Editor widgets](rich_text_internals.md#editor-widgets) * [Editor plugins](rich_text_internals.md#editor-plugins) * [Format converters](rich_text_internals.md#format-converters) * [Extending the Draftail editor](extending_draftail.md) * [Formatting extensions](extending_draftail.md#formatting-extensions) * [Other editor extensions](extending_draftail.md#other-editor-extensions) * [Integration of the Draftail widgets](extending_draftail.md#integration-of-the-draftail-widgets) * [Adding custom bulk actions](custom_bulk_actions.md) * [Registering a custom bulk action](custom_bulk_actions.md#registering-a-custom-bulk-action) * [Adding bulk actions to the page explorer](custom_bulk_actions.md#adding-bulk-actions-to-the-page-explorer) * [Adding bulk actions to the Images listing](custom_bulk_actions.md#adding-bulk-actions-to-the-images-listing) * [Adding bulk actions to the documents listing](custom_bulk_actions.md#adding-bulk-actions-to-the-documents-listing) * [Adding bulk actions to the user listing](custom_bulk_actions.md#adding-bulk-actions-to-the-user-listing) * [Adding bulk actions to the snippets listing](custom_bulk_actions.md#adding-bulk-actions-to-the-snippets-listing) # index.html.md # Tutorial * [Customize your home page](customize_homepage.md) * [Add content to your homepage](customize_homepage.md#add-content-to-your-homepage) * [Create a footer for all pages](create_footer_for_all_pages.md) * [Add a base app](create_footer_for_all_pages.md#add-a-base-app) * [Create navigation settings](create_footer_for_all_pages.md#create-navigation-settings) * [Add your social media links](create_footer_for_all_pages.md#add-your-social-media-links) * [Display social media links](create_footer_for_all_pages.md#display-social-media-links) * [Create editable footer text with Wagtail Snippets](create_footer_for_all_pages.md#create-editable-footer-text-with-wagtail-snippets) * [Add footer text](create_footer_for_all_pages.md#add-footer-text) * [Display your footer text](create_footer_for_all_pages.md#display-your-footer-text) * [Set up site menu for linking to the homepage and other pages](set_up_site_menu.md) * [Add pages to your site menu](set_up_site_menu.md#add-pages-to-your-site-menu) * [Style and improve user experience](style_your_site.md) * [Add styles](style_your_site.md#add-styles) * [Improve user experience](style_your_site.md#improve-user-experience) * [Create contact page](create_contact_page.md) * [Add your contact information](create_contact_page.md#add-your-contact-information) * [Style your contact page](create_contact_page.md#style-your-contact-page) * [Create a portfolio page](create_portfolio_page.md) * [What is StreamField?](create_portfolio_page.md#what-is-streamfield) * [Create reusable custom blocks](create_portfolio_page.md#create-reusable-custom-blocks) * [Use the blocks you created in your portfolio app](create_portfolio_page.md#use-the-blocks-you-created-in-your-portfolio-app) * [Add more custom blocks](create_portfolio_page.md#add-more-custom-blocks) * [Add your resume](create_portfolio_page.md#add-your-resume) * [Add search to your site](add_search.md) * [Deploy your site](deployment.md) * [Where next](deployment.md#where-next) Congratulations on completing [Your first Wagtail site](../getting_started/tutorial.md) tutorial! Now that you’ve completed the beginner tutorial and built a blog site from scratch, you should have a solid understanding of the basic building blocks of a Wagtail website. We hope you enjoyed learning all about Wagtail. Now that you can build a blog site with Wagtail, why stop there? We created this extended tutorial to help you grow your Wagtail knowledge. In this tutorial, you’ll transform your blog site into a fully deployable portfolio site. You must first complete the [Your First Wagtail Site](../getting_started/tutorial.md) tutorial before you begin this extended tutorial. You’ll learn the following in this tutorial: - How to add pagination to your Wagtail website - How to use Wagtail StreamField - How to use Wagtail documents - How to use snippets across multiple web pages - How to use Wagtail forms - How to implement the search feature in a Wagtail website - How to deploy a Wagtail website Now, let’s dive in. # 0.4.1.html.md # Wagtail 0.4.1 release notes *July 14, 2014* ## Bug fixes * Elasticsearch backend now respects the backward-compatible URLS configuration setting, in addition to HOSTS * Documentation fixes # 0.4.html.md # Wagtail 0.4 release notes *July 10, 2014* > * [What’s new](#what-s-new) > * [Backwards-incompatible changes](#backwards-incompatible-changes) > * [Deprecated features](#deprecated-features) ## What’s new ### Private Pages Wagtail now supports password protecting pages on the frontend, allowing sections of your website to be made private. [Private pages](../advanced_topics/privacy.md#private-pages) ### Python 3 support Wagtail now supports Python 3.2, 3.3 and 3.4. ### Scheduled publishing Editors can now schedule pages to be published or unpublished at specified times. A new management command has been added ([publish_scheduled_pages](../reference/management_commands.md#publish-scheduled)) to publish pages that have been scheduled by an editor. ### Search on QuerySet with Elasticsearch It’s now possible to perform searches with Elasticsearch on `PageQuerySet` objects: ```console >>> from wagtail.core.models import Page >>> Page.objects.live().descendant_of(events_index).search("Hello") [, ] ``` ### Sitemap generation A new module has been added (`wagtail.contrib.wagtailsitemaps`) which produces XML sitemaps for Wagtail sites. [Sitemap generator](../reference/contrib/sitemaps.md#sitemap-generation) ### Front-end cache invalidation A new module has been added (`wagtail.contrib.wagtailfrontendcache`) which invalidates pages in a frontend cache when they are updated or deleted in Wagtail. [Frontend cache invalidator](../reference/contrib/frontendcache.md#frontend-cache-purging) ### Notification preferences Users can now decide which notifications they receive from Wagtail using a new “Notification preferences” section located in the account settings. ### Minor features #### Core * Any extra arguments given to `Page.serve` are now passed through to `get_context` and `get_template` * Added `in_menu` and `not_in_menu` methods to `PageQuerySet` * Added `search` method to `PageQuerySet` * Added `get_next_siblings` and `get_prev_siblings` to `Page` * Added `page_published` signal * Added `copy` method to `Page` to allow copying of pages * Added `construct_whitelister_element_rules` hook for customizing the HTML whitelist used when saving `RichText` fields * Support for setting a `subpage_types` property on `Page` models, to define which page types are allowed as subpages #### Admin * Removed the “More” section from the menu * Added pagination to page listings * Added a new datetime picker widget * Updated `hallo.js` to version 1.0.4 * Aesthetic improvements to preview experience * Login screen redirects to dashboard if user is already logged in * Snippets are now ordered alphabetically * Added `init_new_page` signal #### Search * Added a new way to configure searchable/filterable fields on models * Added `get_indexed_objects` allowing developers to customize which objects get added to the search index * Major refactor of Elasticsearch backend * Use `match` instead of `query_string` queries * Fields are now indexed in Elasticsearch with their correct type * Filter fields are no longer included in `_all` * Fields with partial matching are now indexed together into `_partials` #### Images * Added `original` as a resizing rule supported by the `{% image %}` tag * `image` tag now accepts extra keyword arguments to be output as attributes on the `img` tag * Added an `attrs` property to image rendition objects to output `src`, `width`, `height` and `alt` attributes all in one go #### Other * Added styleguide, for Wagtail developers ### Bug fixes * Animated GIFs are now coalesced before resizing * The Wand backend clones images before modifying them * The admin breadcrumb is now positioned correctly on mobile * The page chooser breadcrumb now updates the chooser modal instead of linking to Explorer * Embeds - fixed crash when no HTML field is sent back from the embed provider * Multiple sites with same hostname but different ports are now allowed * It is no longer possible to create multiple sites with `is_default_site = True` ## Backwards-incompatible changes ### ElasticUtils replaced with elasticsearch-py If you are using the Elasticsearch backend, you must install the `elasticsearch` module into your environment. #### NOTE If you are using an older version of Elasticsearch (< 1.0) you must install `elasticsearch` version 0.4.x. ### Addition of `expired` column may break old data migrations involving pages The scheduled publishing mechanism adds an `expired` field to wagtailcore.Page, defaulting to False. Any application code working with Page objects should be unaffected, but any code that creates page records using direct SQL, or within existing South migrations using South’s frozen ORM, will fail as this code will be unaware of the `expired` database column. To fix a South migration that fails in this way, add the following line to the `'wagtailcore.page'` entry at the bottom of the migration file: ```python 'expired': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), ``` ## Deprecated features ### Template tag libraries renamed The following template tag libraries have been renamed: * `pageurl` => `wagtailcore_tags` * `rich_text` => `wagtailcore_tags` * `embed_filters` => `wagtailembeds_tags` * `image_tags` => `wagtailimages_tags` The old names will continue to work, but output a `DeprecationWarning` - you are advised to update any `{% load %}` tags in your templates to refer to the new names. ### New search field configuration format `indexed_fields` is now deprecated and has been replaced by a new search field configuration format called `search_fields`. See [Indexing](../topics/search/indexing.md#wagtailsearch-indexing) for how to define a `search_fields` property on your models. ### `Page.route` method should now return a `RouteResult` Previously, the `route` method called `serve` and returned an `HttpResponse` object. This has now been split up so `serve` is called separately and `route` must now return a RouteResult object. If you are overriding `Page.route` on any of your page models, you will need to update the method to return a `RouteResult` object. The old method of returning an `HttpResponse` will continue to work, but this will throw a `DeprecationWarning` and bypass the `before_serve_page` hook, which means in particular that [Private pages](../advanced_topics/privacy.md#private-pages) will not work on those page types. See [Adding Endpoints with Custom route() Methods](../reference/pages/model_recipes.md#overriding-route-method). ### Wagtailadmins `hooks` module has moved to wagtailcore If you use any `wagtail_hooks.py` files in your project, you may have an import like: `from wagtail.wagtailadmin import hooks` Change this to: `from wagtail.core import hooks` ### Miscellaneous * `Page.show_as_mode` replaced with `Page.serve_preview` * `Page.get_page_modes` method replaced with `Page.preview_modes` property * `Page.get_other_siblings` replaced with `Page.get_siblings(inclusive=False)` # 0.5.html.md # Wagtail 0.5 release notes *August 1, 2014* > * [What’s new](#what-s-new) > * [Upgrade considerations](#upgrade-considerations) ## What’s new ### Multiple image uploader The image uploader UI has been improved to allow multiple images to be uploaded at once. ### Image feature detection Wagtail can now apply face and feature detection on images using [OpenCV](https://opencv.org/), and use this to intelligently crop images. [Feature detection](../advanced_topics/images/feature_detection.md#image-feature-detection) ### Using images outside Wagtail In normal use, Wagtail will generate resized versions of images at the point that they are referenced on a template, which means that those images are not easily accessible for use outside of Wagtail, such as displaying them on external sites. Wagtail now provides a way to obtain URLs to your images, at any size. [Dynamic image serve view](../advanced_topics/images/image_serve_view.md#using-images-outside-wagtail) ### RoutablePage A `RoutablePage` model has been added to allow embedding Django-style URL routing within a page. [RoutablePageMixin](../reference/contrib/routablepage.md#routable-page-mixin) ### Usage stats for images, documents and snippets It’s now easier to find where a particular image, document or snippet is being used on your site. Set the `WAGTAIL_USAGE_COUNT_ENABLED` setting to `True` and an icon will appear on the edit page showing you which pages they have been used on. ### Copy Page action The explorer interface now offers the ability to copy pages, with or without subpages. ### Minor features #### Core * Hooks can now be defined using decorator syntax: ```python @hooks.register('construct_main_menu') def construct_main_menu(request, menu_items): menu_items.append( MenuItem('Kittens!', '/kittens/', classnames='icon icon-folder-inverse', order=1000) ) ``` * The lxml library (used for whitelisting and rewriting of rich text fields) has been replaced with the pure-python html5lib library, to simplify installation. * A `page_unpublished` signal has been added. #### Admin * Explorer nav now rendered separately and fetched with AJAX when needed. This improves the general performance of the admin interface for large sites. ### Bug fixes * Updates to tag fields are now properly committed to the database when publishing directly from the page edit interface. ## Upgrade considerations ### Urlconf entries for `/admin/images/`, `/admin/embeds/` etc need to be removed If you created a Wagtail project before the release of Wagtail 0.3, it is likely to contain the following entries in its `urls.py`: ```python # TODO: some way of getting wagtailimages to register itself within wagtailadmin so that we # don't have to define it separately here url(r'^admin/images/', include(wagtailimages_urls)), url(r'^admin/embeds/', include(wagtailembeds_urls)), url(r'^admin/documents/', include(wagtaildocs_admin_urls)), url(r'^admin/snippets/', include(wagtailsnippets_urls)), url(r'^admin/search/', include(wagtailsearch_admin_urls)), url(r'^admin/users/', include(wagtailusers_urls)), url(r'^admin/redirects/', include(wagtailredirects_urls)), ``` These entries (and the corresponding `from wagtail.wagtail* import ...` lines) need to be removed from `urls.py`. (The entry for `/admin/` should be left in, however.) Since Wagtail 0.3, the wagtailadmin module automatically takes care of registering these URL subpaths, so these entries are redundant, and these urlconf modules are not guaranteed to remain stable and backwards-compatible in the future. Leaving these entries in place will now cause an `ImproperlyConfigured` exception to be thrown. ### New fields on Image and Rendition models Several new fields have been added to the Image and Rendition models to support [Feature detection](../advanced_topics/images/feature_detection.md#image-feature-detection). These will be added to the database when you run `./manage.py migrate`. If you have defined a custom image model (by extending the `wagtailimages.AbstractImage` and `wagtailimages.AbstractRendition` classes and specifying `WAGTAILIMAGES_IMAGE_MODEL` in settings), the change needs to be applied to that model’s database table too. Running the command: ```console $ ./manage.py schemamigration myapp --auto add_image_focal_point_fields ``` (with ‘myapp’ replaced with your app name) will generate the necessary migration file. ### South upgraded to 1.0 In preparation for Django 1.7 support in a future release, Wagtail now depends on South 1.0, and its migration files have been moved from `migrations` to `south_migrations`. Older versions of South will fail to find the migrations in the new location. If your project’s requirements file (most commonly requirements.txt or requirements/base.txt) references a specific older version of South, this must be updated to South 1.0. # 0.6.html.md # Wagtail 0.6 release notes *September 11, 2014* > * [What’s new](#what-s-new) > * [Upgrade considerations](#upgrade-considerations) > * [Deprecated features](#deprecated-features) ## What’s new ### Project template and start project command Wagtail now has a basic project template built in to make starting new projects much easier. To use it, install `wagtail` onto your machine and run `wagtail start project_name`. ### Django 1.7 support Wagtail can now be used with Django 1.7. ### Minor features * A new template tag has been added for reversing URLs inside routable pages. See [The routablepageurl template tag](../reference/contrib/routablepage.md#routablepageurl-template-tag). * RoutablePage can now be used as a mixin. See [RoutablePageMixin](../reference/contrib/routablepage.md#routable-page-mixin). * MenuItems can now have bundled JavaScript * Added the `register_admin_menu_item` hook for registering menu items at startup. See [Hooks](../reference/hooks.md#admin-hooks) * Added a version indicator into the admin interface (hover over the wagtail to see it) * Added Russian translation ### Bug fixes * Page URL generation now returns correct URLs for sites that have the main ‘serve’ view rooted somewhere other than ‘/’. * Search results in the page chooser now respect the page_type parameter on PageChooserPanel. * Rendition filenames are now prevented from going over 60 chars, even with a large focal_point_key. * Child relations that are defined on a model’s superclass (such as the base Page model) are now picked up correctly by the page editing form, page copy operations and the replace_text management command. * Tags on images and documents are now committed to the search index immediately on saving. ## Upgrade considerations ### All features deprecated in 0.4 have been removed See: [Deprecated features](0.4.md#deprecated-features) ### Search signal handlers have been moved If you have an import in your `urls.py` file like `from wagtail.wagtailsearch import register_signal_handlers`, this must now be changed to `from wagtail.wagtailsearch.signal_handlers import register_signal_handlers` ## Deprecated features * The `wagtail.wagtailsearch.indexed` module has been renamed to `wagtail.wagtailsearch.index` # 0.7.html.md # Wagtail 0.7 release notes *October 9, 2014* > * [What’s new](#what-s-new) > * [Upgrade considerations](#upgrade-considerations) ## What’s new ### New interface for choosing image focal point ![image](_static/images/releasenotes_0_7_focal-point-adjustment.jpg) When editing images, users can now specify a ‘focal point’ region that cropped versions of the image will be centered on. Previously the focal point could only be set automatically, through image feature detection. ### Groups and Sites administration interfaces ![image](_static/images/releasenotes_0_7_editor-management.png) The main navigation menu has been reorganized, placing site configuration options in a ‘Settings’ submenu. This includes two new items, which were previously only available through the Django admin backend: ‘Groups’, for setting up user groups with a specific set of permissions, and ‘Sites’, for managing the list of sites served by this Wagtail instance. ### Page locking ![image](_static/images/releasenotes_0_7_page-locking.png) Moderators and administrators now can lock a page, preventing further edits from being made to that page until it is unlocked again. ### Minor features * The `content_type` template filter has been removed from the project template, as the same thing can be accomplished with `self.get_verbose_name|slugify`. * Page copy operations now also copy the page revision history. * Page models now support a `parent_page_types` property in addition to `subpage types`, to restrict the types of page they can be created under. * `register_snippet` can now be invoked as a decorator. * The project template (used when running `wagtail start`) has been updated to Django 1.7. * The ‘boost’ applied to the title field on searches has been reduced from 100 to 2. * The `type` method of `PageQuerySet` (used to filter the QuerySet to a specific page type) now includes subclasses of the given page type. * The `update_index` management command now updates all backends listed in `WAGTAILSEARCH_BACKENDS`, or a specific one passed on the command line, rather than just the default backend. * The ‘fill’ image resize method now supports an additional parameter defining the closeness of the crop. See [How to use images in templates](../topics/images.md#image-tag) * Added support for invalidating Cloudflare caches. See [Frontend cache invalidator](../reference/contrib/frontendcache.md#frontend-cache-purging) * Pages in the explorer can now be ordered by last updated time. ### Bug fixes * The ‘wagtail start’ command now works on Windows and other environments where the `django-admin.py` executable is not readily accessible. * The external image URL generator no longer stores generated images in Django’s cache; this was an unintentional side-effect of setting cache control headers. * The Elasticsearch backend can now search QuerySets that have been filtered with an ‘in’ clause of a non-list type (such as a `ValuesListQuerySet`). * Logic around the `has_unpublished_changes` flag has been fixed, to prevent issues with the ‘View draft’ button failing to show in some cases. * It is now easier to move pages to the beginning and end of their section * Image rendering no longer creates erroneous duplicate Rendition records when the focal point is blank. ## Upgrade considerations ### Addition of `wagtailsites` app The Sites administration interface is contained within a new app, `wagtailsites`. To enable this on an existing Wagtail project, add the line: ```python 'wagtail.wagtailsites', ``` to the `INSTALLED_APPS` list in your project’s settings file. ### Title boost on search reduced to 2 Wagtail’s search interface applies a ‘boost’ value to give extra weighting to matches on the title field. The original boost value of 100 was found to be excessive, and in Wagtail 0.7 this has been reduced to 2. If you have used comparable boost values on other fields, to give them similar weighting to title, you may now wish to reduce these accordingly. See [Indexing](../topics/search/indexing.md#wagtailsearch-indexing). ### Addition of `locked` field to Page model The page locking mechanism adds a `locked` field to wagtailcore.Page, defaulting to False. Any application code working with Page objects should be unaffected, but any code that creates page records using direct SQL, or within existing South migrations using South’s frozen ORM, will fail as this code will be unaware of the new database column. To fix a South migration that fails in this way, add the following line to the `'wagtailcore.page'` entry at the bottom of the migration file: ```python 'locked': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), ``` ### Update to `focal_point_key` field on custom Rendition models The `focal_point_key` field on wagtailimages.Rendition has been changed to `null=False`, to fix an issue with duplicate renditions being created. If you have defined a custom Rendition model in your project (by extending the `wagtailimages.AbstractRendition` class), you will need to apply a migration to make the corresponding change on your custom model. Unfortunately, neither South nor Django 1.7’s migration system can generate this automatically - you will need to customize the migration produced by `./manage.py schemamigration` / `./manage.py makemigrations`, using the wagtailimages migration as a guide: - [https://github.com/wagtail/wagtail/blob/stable/0.7.x/wagtail/wagtailimages/south_migrations/0004_auto_\_chg_field_rendition_focal_point_key.py](https://github.com/wagtail/wagtail/blob/stable/0.7.x/wagtail/wagtailimages/south_migrations/0004_auto__chg_field_rendition_focal_point_key.py) (for South / Django 1.6) - [https://github.com/wagtail/wagtail/blob/stable/0.7.x/wagtail/wagtailimages/migrations/0004_make_focal_point_key_not_nullable.py](https://github.com/wagtail/wagtail/blob/stable/0.7.x/wagtail/wagtailimages/migrations/0004_make_focal_point_key_not_nullable.py) (for Django 1.7) # 0.8.1.html.md # Wagtail 0.8.1 release notes *November 5, 2014* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes * Fixed a regression where images would fail to save when feature detection is active # 0.8.10.html.md # Wagtail 0.8.10 release notes *September 16, 2015* > * [What’s changed](#what-s-changed) ## What’s changed ### Bug fixes * When copying a page, IDs of child objects within page revision records were not remapped to the new objects; this would cause those objects to be lost from the original page when editing the new one * Search no longer crashes when auto-indexing a model that doesn’t have an id field (Scot Hacker) * Resizing single pixel images with the “fill” filter no longer raises `ZeroDivisionError` or “tile cannot extend outside image” # 0.8.3.html.md # Wagtail 0.8.3 release notes *November 18, 2014* > * [What’s new](#what-s-new) > * [Upgrade considerations](#upgrade-considerations) ## What’s new ### Bug fixes * Added missing jQuery UI sprite files, causing collectstatic to throw errors (most reported on Heroku) * Page system check for on_delete actions of ForeignKeys was throwing false positives when page class descends from an abstract class (Alejandro Giacometti) * Page system check for on_delete actions of ForeignKeys now only raises warnings, not errors * Fixed a regression where form builder submissions containing a number field would fail with a JSON serialization error * Resizing an image with a focal point equal to the image size would result in a divide-by-zero error * Focal point indicator would sometimes be positioned incorrectly for small or thin images * Fix: Focal point chooser background color changed to grey to make working with transparent images easier * Elasticsearch configuration now supports specifying HTTP authentication parameters as part of the URL, and defaults to ports 80 (HTTP) and 443 (HTTPS) if port number not specified * Fixed a TypeError when previewing pages that use RoutablePageMixin * Rendering image with missing file in rich text no longer crashes the entire page * IOErrors thrown by underlying image libraries that are not reporting a missing image file are no longer caught * Fix: Minimum Pillow version bumped to 2.6.1 to work around a crash when using images with transparency * Fix: Images with transparency are now handled better when being used in feature detection ## Upgrade considerations ### Port number must be specified when running Elasticsearch on port 9200 In previous versions, an Elasticsearch connection URL in `WAGTAILSEARCH_BACKENDS` without an explicit port number (e.g. `http://localhost/`) would be treated as port 9200 (the Elasticsearch default) whereas the correct behavior would be to use the default http/https port of 80/443. This behavior has now been fixed, so sites running Elasticsearch on port 9200 must now specify this explicitly - e.g. `http://localhost:9200`. (Projects using the default settings, or the settings given in the Wagtail documentation, are unaffected.) # 0.8.4.html.md # Wagtail 0.8.4 release notes *December 4, 2014* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes * It is no longer possible to have the explorer and settings menu open at the same time * Page IDs in page revisions were not updated on page copy, causing subsequent edits to be committed to the original page instead * Copying a page now creates a new page revision, ensuring that changes to the title/slug are correctly reflected in the editor (and also ensuring that the user performing the copy is logged) * Prevent a race condition when creating Filter objects * On adding a new page, the available page types are ordered by the displayed verbose name # 0.8.5.html.md # Wagtail 0.8.5 release notes *February 17, 2015* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes * On adding a new page, the available page types are ordered by the displayed verbose name * Active admin submenus were not properly closed when activating another * `get_sitemap_urls` is now called on the specific page class so it can now be overridden * (Firefox and IE) Fixed preview window hanging and not refocusing when “Preview” button is clicked again * Storage backends that return raw ContentFile objects are now handled correctly when resizing images * Punctuation characters are no longer stripped when performing search queries * When adding tags where there were none before, it is now possible to save a single tag with multiple words in it * `richtext` template tag no longer raises `TypeError` if `None` is passed into it * Serving documents now uses a streaming HTTP response and will no longer break Django’s cache middleware * User admin area no longer fails in the presence of negative user IDs (as used by `django-guardian`’s default settings) * Password reset emails now use the `BASE_URL` setting for the reset URL * `BASE_URL` is now included in the project template’s default settings file # 0.8.6.html.md # Wagtail 0.8.6 release notes *March 10, 2015* > * [What’s new](#what-s-new) > * [Upgrade considerations](#upgrade-considerations) ## What’s new ### Minor features * Translations updated, including new translations for Czech, Italian and Japanese * The “fixtree” command can now delete orphaned pages ### Bug fixes * django-taggit library updated to 0.12.3, to fix a bug with migrations on SQLite on Django 1.7.2 and above ([https://github.com/alex/django-taggit/issues/285](https://github.com/alex/django-taggit/issues/285)) * Fixed a bug that caused children of a deleted page to not be deleted if they had a different type ## Upgrade considerations ### Orphaned pages may need deleting This release fixes a bug with page deletion introduced in 0.8, where deleting a page with child pages will result in those child pages being left behind in the database (unless the child pages are of the same type as the parent). This may cause errors later on when creating new pages in the same position. To identify and delete these orphaned pages, it is recommended that you run the following command (from the project root) after upgrading to 0.8.6: ```console $ ./manage.py fixtree ``` This will output a list of any orphaned pages found, and request confirmation before deleting them. Since this now makes `fixtree` an interactive command, a `./manage.py fixtree --noinput` option has been added to restore the previous non-interactive behavior. With this option enabled, deleting orphaned pages is always skipped. # 0.8.7.html.md # Wagtail 0.8.7 release notes *April 29, 2015* > * [What’s changed](#what-s-changed) ## What’s changed ### Bug fixes * `wagtailfrontendcache` no longer tries to purge pages that are not in a site * The contents of `
` elements in the rich text editor were not being whitelisted * Due to the above issue, embeds/images in a rich text field would sometimes be saved into the database in their editor representation * RoutablePage now prevents `subpage_urls` from being defined as a property, which would cause a memory leak * Added validation to prevent pages being created with only whitespace characters in their title fields * Users are no longer logged out on changing password when SessionAuthenticationMiddleware (added in Django 1.7) is in use * Added a workaround for a Python / Django issue that prevented documents with certain non-ASCII filenames from being served # 0.8.8.html.md # Wagtail 0.8.8 release notes *June 18, 2015* > * [What’s changed](#what-s-changed) ## What’s changed ### Bug fixes * Form builder no longer raises a `TypeError` when submitting unchecked boolean field * Image upload form no longer breaks when using i10n thousand separators * Multiple image uploader now escapes HTML in filenames * Retrieving an individual item from a sliced `BaseSearchResults` object now properly takes the slice offset into account * Removed dependency on unicodecsv which fixes a crash on Python 3 * Submitting unicode text in form builder form no longer crashes with `UnicodeEncodeError` on Python 2 * Creating a proxy model from a Page class no longer crashes in the system check * Unrecognised embed URLs passed to the `|embed` filter no longer cause the whole page to crash with an `EmbedNotFoundException` * Underscores no longer get stripped from page slugs # 0.8.html.md # Wagtail 0.8 (LTS) release notes *November 5, 2014* > * [What’s new](#what-s-new) > * [Upgrade considerations](#upgrade-considerations) Wagtail 0.8 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 8 months). ## What’s new ### Minor features * Page operations (creation, publishing, copying etc) are now logged via Python’s `logging` framework; to configure this, add a logger entry for `'wagtail'` or `'wagtail.core'` to the `LOGGING` setup in your settings file. * The save button on the page edit page now redirects the user back to the edit page instead of the explorer * Signal handlers for `wagtail.wagtailsearch` and `wagtail.contrib.wagtailfrontendcache` are now automatically registered when using Django 1.7 or above. * Added a Django 1.7 system check to ensure that foreign keys from Page models are set to `on_delete=SET_NULL`, to prevent inadvertent (and tree-breaking) page deletions * Improved error reporting on image upload, including ability to set a maximum file size via a new setting `WAGTAILIMAGES_MAX_UPLOAD_SIZE` * The external image URL generator now keeps persistent image renditions, rather than regenerating them on each request, so it no longer requires a front-end cache. * Added Dutch translation ### Bug fixes * Replaced references of .username with .get_username() on users for better custom user model support * Unpinned dependency versions for six and requests to help prevent dependency conflicts * Fixed TypeError when getting embed HTML with oembed on Python 3 * Made HTML whitelisting in rich text fields more robust at catching disallowed URL schemes such as `jav\tascript:` * `created_at` timestamps on page revisions were not being preserved on page copy, causing revisions to get out of sequence * When copying pages recursively, revisions of subpages were being copied regardless of the `copy_revisions` flag * Updated the migration dependencies within the project template to ensure that Wagtail’s own migrations consistently apply first * The cache of site root paths is now cleared when a site is deleted * Search indexing now prevents pages from being indexed multiple times, as both the base Page model and the specific subclass * Search indexing now avoids trying to index abstract models * Fixed references to “username” in login form help text for better custom user model support * Later items in a model’s search_field list now consistently override earlier items, allowing subclasses to redefine rules from the parent * Image uploader now accepts JPEG images that PIL reports as being in MPO format * Multiple checkbox fields on form-builder forms did not correctly save multiple values * Editing a page’s slug and saving it without publishing could sometimes cause the URL paths of child pages to be corrupted * `latest_revision_created_at` was being cleared on page publish, causing the page to drop to the bottom of explorer listings * Searches on partial_match fields were wrongly applying prefix analysis to the search query as well as the document (causing e.g. a query for “water” to match against “wagtail”) ## Upgrade considerations ### Corrupted URL paths may need fixing This release fixes a bug in Wagtail 0.7 where editing a parent page’s slug could cause the URL paths of child pages to become corrupted. To ensure that your database does not contain any corrupted URL paths, it is recommended that you run `./manage.py set_url_paths` after upgrading. ### Automatic registration of signal handlers (Django 1.7+) Signal handlers for the `wagtailsearch` core app and `wagtailfrontendcache` contrib app are automatically registered when using Django 1.7. Calls to `register_signal_handlers` from your `urls.py` can be removed. ### Change to search API when using database backend When using the database backend, calling search (either through `Page.objects.search()` or on the backend directly) will now return a `SearchResults` object rather than a Django `QuerySet` to make the database backend work more like the Elasticsearch backend. This change shouldn’t affect most people as `SearchResults` behaves very similarly to `QuerySet`. But it may cause issues if you are calling `QuerySet` specific methods after calling `.search()`. Eg: `Page.objects.search("Hello").filter(foo="Bar")` (in this case, `.filter()` should be moved before `.search()` and it would work as before). ### Removal of validate_image_format from custom image model migrations (Django 1.7+) If your project is running on Django 1.7, and you have defined a custom image model (by extending the `wagtailimages.AbstractImage` class), the migration that creates this model will probably have a reference to `wagtail.wagtailimages.utils.validators.validate_image_format`. This module has now been removed, which will cause `manage.py migrate` to fail with an `ImportError` (even if the migration has already been applied). You will need to edit the migration file to remove the line: ```python import wagtail.wagtailimages.utils.validators ``` and the `validators` attribute of the ‘file’ field - that is, the line: ```python ('file', models.ImageField(upload_to=wagtail.wagtailimages.models.get_upload_to, width_field='width', height_field='height', validators=[wagtail.wagtailimages.utils.validators.validate_image_format], verbose_name='File')), ``` should become: ```python ('file', models.ImageField(upload_to=wagtail.wagtailimages.models.get_upload_to, width_field='width', height_field='height', verbose_name='File')), ``` # 1.0.html.md # Wagtail 1.0 release notes *July 16, 2015* > * [What’s changed](#what-s-changed) > * [Upgrade considerations](#upgrade-considerations) ## What’s changed ### StreamField - a field type for freeform content StreamField provides an editing model for freeform content such as blog posts and news stories, allowing diverse content types such as text, images, headings, video and more specialized types such as maps and charts to be mixed in any order. See [How to use StreamField for mixed content](../topics/streamfield.md#streamfield-topic). ### Wagtail API - A RESTful API for your Wagtail site When installed, the new Wagtail API module provides a RESTful web API to your Wagtail site. You can use this for accessing your raw field content for your sites pages, images and documents in JSON format. ### MySQL support Wagtail now officially supports MySQL as a database backend. ### Django 1.8 support Wagtail now officially supports running under Django 1.8. ### Vanilla project template The built-in project template is more like the Django built-in one with several Wagtail-specific additions. It includes bare minimum settings and two apps (home and search). ### Minor changes * Dropped Django 1.6 support * Dropped Python 2.6 and 3.2 support * Dropped Elasticsearch 0.90.x support * Removed dependency on `libsass` * Users without usernames can now be created and edited in the admin interface * Added new translations for Croatian and Finnish #### Core * The Page model now records the date/time that a page was first published, as the field `first_published_at` * Increased the maximum length of a page slug from 50 to 255 characters * Added hooks `register_rich_text_embed_handler` and `register_rich_text_link_handler` for customizing link / embed handling within rich text fields * Page URL paths can now be longer than 255 characters #### Admin **UI** * Improvements to the layout of the left-hand menu footer * Menu items of custom apps are now highlighted when being used * Added thousands separator for counters on dashboard * Added contextual links to admin notification messages * When copying pages, it is now possible to specify a place to copy to * Added pagination to the snippets listing and chooser * Page / document / image / snippet choosers now include a link to edit the chosen item * Plain text fields in the page editor now use auto-expanding text areas * Added “Add child page” button to admin userbar * Added update notifications (See: [Wagtail update notifications](../reference/settings.md#update-notifications)) **Page editor** * JavaScript includes in the admin backend have been moved to the HTML header, to accommodate form widgets that render inline scripts that depend on libraries such as jQuery * The external link chooser in rich text areas now accepts URLs of the form ‘/some/local/path’, to allow linking to non-Wagtail-controlled URLs within the local site * Bare text entered in rich text areas is now automatically wrapped in a paragraph element **Edit handlers API** * `FieldPanel` now accepts an optional `widget` parameter to override the field’s default form widget * Page model fields without a `FieldPanel` are no longer displayed in the form * No longer need to specify the base model on `InlinePanel` definitions * Page classes can specify an edit_handler property to override the default Content / Promote / Settings tabbed interface. See [Customizing the tabbed interface](../advanced_topics/customization/page_editing_interface.md#customizing-the-tabbed-interface). **Other admin changes** * SCSS files in wagtailadmin now use absolute imports, to permit overriding by user stylesheets * Removed the dependency on `LOGIN_URL` and `LOGIN_REDIRECT_URL` settings * Password reset view names namespaced to wagtailadmin * Removed the need to add permission check on admin views (now automated) * Reversing `django.contrib.auth.admin.login` will no longer lead to Wagtails login view (making it easier to have frontend login views) * Added cache-control headers to all admin views. This allows Varnish/Squid/CDN to run on vanilla settings in front of a Wagtail site * Date / time pickers now consistently use times without seconds, to prevent JavaScript behaviour glitches when focusing / unfocusing fields * Added hook `construct_homepage_summary_items` for customizing the site summary panel on the admin homepage * Renamed the `construct_wagtail_edit_bird` hook to `construct_wagtail_userbar` * ‘static’ template tags are now used throughout the admin templates, in place of `STATIC_URL` #### Docs * Support for `django-sendfile` added * Documents now served with correct mime-type * Support for `If-Modified-Since` HTTP header #### Search * Search view accepts “page” GET parameter in line with pagination * Added [AUTO_UPDATE](../topics/search/backends.md#wagtailsearch-backends-auto-update) flag to search backend settings to enable/disable automatically updating the search index on model changes #### Routable pages * Added a new decorator-based syntax for RoutablePage, compatible with Django 1.8 ### Bug fixes * The `document_served` signal now correctly passes the Document class as `sender` and the document as `instance` * Image edit page no longer throws `OSError` when the original image is missing * Collapsible blocks stay open on any form error * Document upload modal no longer switches tabs on form errors * `with_metaclass` is now imported from Django’s bundled copy of the `six` library, to avoid errors on Mac OS X from an outdated system copy of the library being imported ## Upgrade considerations ### Support for older Django/Python/Elasticsearch versions dropped This release drops support for Django 1.6, Python 2.6/3.2 and Elasticsearch 0.90.x. Please make sure these are updated before upgrading. If you are upgrading from Elasticsearch 0.90.x, you may also need to update the `elasticsearch` pip package to a version greater than `1.0` as well. ### Wagtail version upgrade notifications are enabled by default Starting from Wagtail 1.0, the admin dashboard will (for admin users only) perform a check to see if newer releases are available. This also provides the Wagtail team with the hostname of your Wagtail site. If you’d rather not receive update notifications, or if you’d like your site to remain unknown, you can disable it by adding this line to your settings file: ```python WAGTAIL_ENABLE_UPDATE_CHECK = False ``` ### `InlinePanel` definitions no longer need to specify the base model In previous versions of Wagtail, inline child blocks on a page or snippet were defined using a declaration like: ```python InlinePanel(HomePage, 'carousel_items', label="Carousel items") ``` It is no longer necessary to pass the base model as a parameter, so this declaration should be changed to: ```python InlinePanel('carousel_items', label="Carousel items") ``` The old format is now deprecated; all existing `InlinePanel` declarations should be updated to the new format. #### Custom image models should now set the `admin_form_fields` attribute Django 1.8 now requires that all the fields in a `ModelForm` must be defined in its `Meta.fields` attribute. As Wagtail uses Django’s `ModelForm` for creating image model forms, we’ve added a new attribute called `admin_form_fields` that should be set to a `tuple` of field names on the image model. See [Custom image models](../advanced_topics/images/custom_image_model.md#custom-image-model) for an example. ### You no longer need `LOGIN_URL` and `LOGIN_REDIRECT_URL` to point to Wagtail admin. If you are upgrading from an older version of Wagtail, you probably want to remove these from your project settings. Previously, these two settings needed to be set to `wagtailadmin_login` and `wagtailadmin_dashboard` respectively or Wagtail would become very tricky to log in to. This is no longer the case and Wagtail should work fine without them. ### `RoutablePage` now uses decorator syntax for defining views In previous versions of Wagtail, page types that used [RoutablePageMixin](../reference/contrib/routablepage.md#routable-page-mixin) had endpoints configured by setting their `subpage_urls` attribute to a list of urls with view names. This will not work on Django 1.8 as view names can no longer be passed into a url (see: [https://docs.djangoproject.com/en/stable/releases/1.8/#django-conf-urls-patterns](https://docs.djangoproject.com/en/stable/releases/1.8/#django-conf-urls-patterns)). Wagtail 1.0 introduces a new syntax where each view function is annotated with a `@route` decorator - see [RoutablePageMixin](../reference/contrib/routablepage.md#routable-page-mixin). The old `subpage_urls` convention will continue to work on Django versions before 1.8, but this is now deprecated; all existing `RoutablePage` definitions should be updated to the decorator-based convention. ### Upgrading from the external `wagtailapi` module. If you were previously using the external `wagtailapi` module (which has now become `wagtail.contrib.wagtailapi`). Please be aware of the following backwards-incompatible changes: **1. Representation of foreign keys has changed** Foreign keys were previously represented by just the value of their primary key. For example: ```python "feed_image": 1 ``` This has now been changed to add some `meta` information: ```python "feed_image": { "id": 1, "meta": { "type": "wagtailimages.Image", "detail_url": "https://api.example.com/api/v1/images/1/" } } ``` **2. On the page detail view, the “parent” field has been moved out of meta** Previously, there was a “parent” field in the “meta” section on the page detail view: ```python { "id": 10, "meta": { "type": "demo.BlogPage", "parent": 2 }, ... } ``` This has now been moved to the top level. Also, the above change to how foreign keys are represented applies to this field too: ```python { "id": 10, "meta": { "type": "demo.BlogPage" }, "parent": { "id": 2, "meta": { "type": "demo.BlogIndexPage" } } ... } ``` ### Celery no longer automatically used for sending notification emails Previously, Wagtail would try to use Celery whenever the `djcelery` module was installed, even if Celery wasn’t set up. This could cause a very hard to track down problem where notification emails would not be sent so this functionality has now been removed. If you would like to keep using Celery for sending notification emails, have a look at: [django-celery-email](https://pypi.python.org/pypi/django-celery-email) ### Login/Password reset views renamed It was previously possible to reverse the Wagtail login view using `django.contrib.auth.views.login`. This is no longer possible. Update any references to `wagtailadmin_login`. Password reset view name has changed from `password_reset` to `wagtailadmin_password_reset`. ### JavaScript includes in admin backend have been moved To improve compatibility with third-party form widgets, pages within the Wagtail admin backend now output their JavaScript includes in the HTML header, rather than at the end of the page. If your project extends the admin backend (through the `register_admin_menu_item` hook, for example) you will need to ensure that all associated JavaScript code runs correctly from the new location. In particular, any code that accesses HTML elements will need to be contained in an ‘onload’ handler (e.g. jQuery’s `$(document).ready()`). ### EditHandler internal API has changed While it is not an official Wagtail API, it has been possible for Wagtail site implementers to define their own `EditHandler` subclasses for use in panel definitions, to customize the behavior of the page / snippet editing forms. If you have made use of this facility, you will need to update your custom EditHandlers, as this mechanism has been refactored (to allow EditHandler classes to keep a persistent reference to their corresponding model). If you have only used Wagtail’s built-in panel types (`FieldPanel`, `InlinePanel`, `PageChooserPanel` and so on), you are unaffected by this change. Previously, functions like `FieldPanel` acted as ‘factory’ functions, where a call such as `FieldPanel('title')` constructed and returned an `EditHandler` subclass tailored to work on a ‘title’ field. These functions now return an object with a `bind_to_model` method instead; the EditHandler subclass can be obtained by calling this with the model class as a parameter. As a guide to updating your custom EditHandler code, you may wish to refer to [the relevant change to the Wagtail codebase](https://github.com/wagtail/wagtail/commit/121c01c7f7db6087a985fa8dc9957bc78b9f6a6a). ### chooser_panel templates are obsolete If you have added your own custom admin views to the Wagtail admin (e.g. through the `register_admin_urls` hook), you may have used one of the following template includes to incorporate a chooser element for pages, documents, images or snippets into your forms: - `wagtailadmin/edit_handlers/chooser_panel.html` - `wagtailadmin/edit_handlers/page_chooser_panel.html` - `wagtaildocs/edit_handlers/document_chooser_panel.html` - `wagtailimages/edit_handlers/image_chooser_panel.html` - `wagtailsnippets/edit_handlers/snippet_chooser_panel.html` All of these templates are now deprecated. Wagtail now provides a set of Django form widgets for this purpose - `AdminPageChooser`, `AdminDocumentChooser`, `AdminImageChooser` and `AdminSnippetChooser` - which can be used in place of the `HiddenInput` widget that these form fields were previously using. The field can then be rendered using the regular `wagtailadmin/shared/field.html` or `wagtailadmin/shared/field_as_li.html` template. ### `document_served` signal arguments have changed Previously, the `document_served` signal (which is fired whenever a user downloads a document) passed the document instance as the `sender`. This has now been changed to correspond the behaviour of Django’s built-in signals; `sender` is now the `Document` class, and the document instance is passed as the argument `instance`. Any existing signal listeners that expect to receive the document instance in `sender` must now be updated to check the `instance` argument instead. ### Custom image models must specify an `admin_form_fields` list Previously, the forms for creating and editing images followed Django’s default behavior of showing all fields defined on the model; this would include any custom fields specific to your project that you defined by subclassing `AbstractImage` and setting `WAGTAILIMAGES_IMAGE_MODEL`. This behavior is risky as it may lead to fields being unintentionally exposed to the user, and so Django has deprecated this, for removal in Django 1.8. Accordingly, if you create your own custom subclass of `AbstractImage`, you must now provide an `admin_form_fields` property, listing the fields that should appear on the image creation / editing form - for example: ```python from wagtail.wagtailimages.models import AbstractImage, Image class MyImage(AbstractImage): photographer = models.CharField(max_length=255) has_legal_approval = models.BooleanField() admin_form_fields = Image.admin_form_fields + ['photographer'] ``` ### `construct_wagtail_edit_bird` hook has been renamed Previously you could customize the Wagtail userbar using the `construct_wagtail_edit_bird` hook. The hook has been renamed to `construct_wagtail_userbar`. The old hook is now deprecated; all existing `construct_wagtail_edit_bird` declarations should be updated to the new hook. ### `IMAGE_COMPRESSION_QUALITY` setting has been renamed The `IMAGE_COMPRESSION_QUALITY` setting, which determines the quality of saved JPEG images as a value from 1 to 100, has been renamed to `WAGTAILIMAGES_JPEG_QUALITY`. If you have used this setting, please update your settings file accordingly. # 1.1.html.md # Wagtail 1.1 release notes *September 15, 2015* > * [What’s new](#what-s-new) > * [Upgrade considerations](#upgrade-considerations) ## What’s new ### `specific()` method on PageQuerySet Usually, an operation that retrieves a QuerySet of pages (such as `homepage.get_children()`) will return them as basic Page instances, which only include the core page data such as title. The `specific()` method (e.g. `homepage.get_children().specific()`) now allows them to be retrieved as their most specific type, using the minimum number of queries. ### “Promoted search results” has moved into its own module Previously, this was implemented in `wagtail.wagtailsearch` but now has been moved into a separate module: `wagtail.contrib.wagtailsearchpromotions` ### Atomic rebuilding of Elasticsearch indexes The Elasticsearch search backend now accepts an experimental `ATOMIC_REBUILD` flag which ensures that the existing search index continues to be available while the `update_index` task is running. See [ATOMIC_REBUILD](../topics/search/backends.md#wagtailsearch-backends-atomic-rebuild). ### The `wagtail.contrib.wagtailapi` module now uses Django REST Framework The `wagtailapi` module is now built on Django REST Framework and it now also has a [library of serialisers](https://github.com/wagtail/wagtail/blob/stable/1.1.x/wagtail/contrib/wagtailapi/serializers.py) that you can use in your own REST Framework based APIs. No user-facing changes have been made. We hope to support more REST framework features, such as a browsable API, in future releases. ### Permissions fixes in the admin interface Several inconsistencies around permissions in the admin interface were fixed in this release: * Removed all permissions for “User profile” (not used) * Removed “delete” permission for Images and documents (not used) * Users can now access images and documents when they only have the “change” permission (previously required “add” permission as well) * Permissions for Users now taken from custom user model, if set (previously always used permissions on Django’s builtin User model) * Groups and Users now respond consistently to their respective “add”, “change” and “delete” permissions ### Searchable snippets Snippets that inherit from `wagtail.wagtailsearch.index.Indexed` are now given a search box on the snippet chooser and listing pages. See [Making snippets searchable](../topics/snippets/features.md#wagtailsnippets-making-snippets-searchable). ### Minor features * Implemented deletion of form submissions * Implemented pagination in the page chooser modal * Changed INSTALLED_APPS in project template to list apps in precedence order * The `{% image %}` tag now supports filters on the image variable, e.g. `{% image primary_img|default:secondary_img width-500 %}` * Moved the style guide menu item into the Settings sub-menu * Search backends can now be specified by module (e.g. `wagtail.wagtailsearch.backends.elasticsearch`), rather than a specific class (`wagtail.wagtailsearch.backends.elasticsearch.ElasticSearch`) * Added `descendant_of` filter to the API * Added optional directory argument to “wagtail start” command * Non-superusers can now view/edit/delete sites if they have the correct permissions * Image file size is now stored in the database, to avoid unnecessary filesystem lookups * Page URL lookups hit the cache/database less often * Updated URLs within the admin backend to use namespaces * The `update_index` task now indexes objects in batches of 1000, to indicate progress and avoid excessive memory use * Added database indexes on PageRevision and Image to improve performance on large sites * Search in page chooser now uses Wagtail’s search framework, to order results by relevance * `PageChooserPanel` now supports passing a list (or tuple) of accepted page types * The snippet type parameter of `SnippetChooserPanel` can now be omitted, or passed as a model name string rather than a model class * Added aliases for the `self` template variable to accommodate Jinja as a templating engine: `page` for pages, `field_panel` for field panels / edit handlers, and `value` for blocks * Added signposting text to the explorer to steer editors away from creating pages at the root level unless they are setting up new sites * “Clear choice” and “Edit this page” buttons are no longer shown on the page field of the group page permissions form * Altered styling of stream controls to be more like all other buttons * Added ability to mark page models as not available for creation using the flag `is_creatable`; pages that are abstract Django models are automatically made non-creatable * New translations for Norwegian Bokmål and Icelandic ### Bug fixes * Text areas in the non-default tab of the page editor now resize to the correct height * Tabs in “insert link” modal in the rich text editor no longer disappear (Tim Heap) * H2 elements in rich text fields were accidentally given a click() binding when put insite a collapsible multi field panel * The `wagtailimages` module is now compatible with remote storage backends that do not allow reopening closed files * Search no longer crashes when auto-indexing a model that doesn’t have an `id` field * The `wagtailfrontendcache` module’s HTTP backend has been rewritten to reliably direct requests to the configured cache hostname * Resizing single pixel images with the “fill” filter no longer raises `ZeroDivisionError` or “tile cannot extend outside image” * The QuerySet returned from `search` operations when using the database search backend now correctly preserves additional properties of the original query, such as `prefetch_related` / `select_related` * Responses from the external image URL generator are correctly marked as streaming and will no longer fail when used with Django’s cache middleware * Page copy now works with pages that use multiple inheritance * Form builder pages now pick up template variables defined in the `get_context` method * When copying a page, IDs of child objects within page revision records were not remapped to the new objects; this would cause those objects to be lost from the original page when editing the new one * Newly added redirects now take effect on all sites, rather than just the site that the Wagtail admin backend was accessed through * Add user form no longer throws a hard error on validation failure ## Upgrade considerations ### “Promoted search results” no longer in `wagtail.wagtailsearch` This feature has moved into a contrib module so is no longer enabled by default. To re-enable it, add `wagtail.contrib.wagtailsearchpromotions` to your `INSTALLED_APPS`: ```python INSTALLED_APPS = [ ... 'wagtail.contrib.wagtailsearchpromotions', ... ``` If you have references to the `wagtail.wagtailsearch.models.EditorsPick` model in your project, you will need to update these to point to the `wagtail.contrib.wagtailsearchpromotions.models.SearchPromotion` model instead. If you created your project using the `wagtail start` command with Wagtail 1.0, you will probably have references to this model in the `search/views.py` file. ### `is_abstract` flag on page models has been replaced by `is_creatable` Previous versions of Wagtail provided an undocumented `is_abstract` flag on page models - not to be confused with Django’s `abstract` Meta flag - to indicate that it should not be included in the list of available page types for creation. (Typically this would be used on model classes that were designed to be subclassed to create new page types, rather than used directly.) To avoid confusion with Django’s distinct concept of abstract models, this has now been replaced by a new flag, `is_creatable`. If you have used `is_abstract = True` on any of your models, you should now change this to `is_creatable = False`. It is not necessary to include this flag if the model is abstract in the Django sense (i.e. it has `abstract = True` in the model’s `Meta` class), since it would never be valid to create pages of that type. # 1.10.1.html.md # Wagtail 1.10.1 release notes *May 19, 2017* > * [What’s changed](#what-s-changed) ## What’s changed ### Bug fixes * Fix admin page preview that was broken 24 hours after previewing a page (Martin Hill) * Removed territory-specific translations for Spanish, Polish, Swedish, Russian and Chinese (Taiwan) that block more complete translations from being used (Matt Westcott) # 1.10.html.md # Wagtail 1.10 release notes *May 3, 2017* > * [What’s new](#what-s-new) > * [Upgrade considerations](#upgrade-considerations) ## What’s new ### PostgreSQL search engine A new search engine has been added to Wagtail which uses PostgreSQL’s built-in full-text search functionality. This means that if you use PostgreSQL to manage your database, you can now get a good quality search engine without needing to install Elasticsearch. This feature was developed at the Arnhem sprint by Bertrand Bordage, Jaap Roes, Arne de Laat and Ramon de Jezus. ### Django 1.11 and Python 3.6 support Wagtail is now compatible with Django 1.11 and Python 3.6. Compatibility fixes were contributed by Tim Graham, Matt Westcott, Mikalai Radchuk and Bertrand Bordage. ### User language preference Users can now set their preferred language for the Wagtail admin interface under Account Settings → Language Preferences. The list of available languages can be configured via the [WAGTAILADMIN_PERMITTED_LANGUAGES](../reference/settings.md#wagtailadmin-permitted-languages) setting. This feature was developed by Daniel Chimeno. ### New admin preview Previewing pages in Wagtail admin interface was rewritten to make it more robust. In previous versions, preview was broken in several scenarios so users often ended up on a blank page with an infinite spinner. An additional setting was created: `WAGTAIL_AUTO_UPDATE_PREVIEW`. It allows users to see changes done in the editor by refreshing the preview tab without having to click again on the preview button. This was developed by Bertrand Bordage. ### Other features * Use minified versions of jQuery and jQuery UI in the admin. Total savings without compression 371 KB (Tom Dyson) * Hooks can now specify the order in which they are run (Gagaro) * Added a `submit_buttons` block to login template (Gagaro) * Added `construct_image_chooser_queryset`, `construct_document_chooser_queryset` and `construct_page_chooser_queryset` hooks (Gagaro) * The homepage created in the project template is now titled “Home” rather than “Homepage” (Karl Hobley) * Signal receivers for custom `Image` and `Rendition` models are connected automatically (Mike Dingjan) * `PageChooserBlock` can now accept a list/tuple of page models as `target_model` (Mikalai Radchuk) * Styling tweaks for the ModelAdmin’s `IndexView` to be more inline with the Wagtail styleguide (Andy Babic) * Added `.nvmrc` to the project root for Node versioning support (Janneke Janssen) * Added `form_fields_exclude` property to ModelAdmin views (Matheus Bratfisch) * User creation / edit form now enforces password validators set in `AUTH_PASSWORD_VALIDATORS` (Bertrand Bordage) * Added support for displaying `non_field_errors` when validation fails in the page editor (Matt Westcott) * Added `WAGTAILADMIN_RECENT_EDITS_LIMIT` setting to define the number of your most recent edits on the dashboard (Maarten Kling) * Added link to the full Elasticsearch setup documentation from the Performance page (Matt Westcott) * Tag input fields now accept spaces in tags by default, and can be overridden with the `TAG_SPACES_ALLOWED` setting (Kees Hink, Alex Gleason) * Page chooser widgets now display the required page type where relevant (Christine Ho) * Site root pages are now indicated with a globe icon in the explorer listing (Nick Smith, Huub Bouma) * Draft page view is now restricted to users with edit / publish permission over the page (Kees Hink) * Added the option to delete a previously saved focal point on a image (Maarten Kling) * Page explorer menu item, search and summary panel are now hidden for users with no page permissions (Tim Heap) * Added support for custom date and datetime formats in input fields (Bojan Mihelac) * Added support for custom Django REST framework serialiser fields in `Page.api_fields` using a new `APIField` class (Karl Hobley) * Added `classname` argument to `StreamFieldPanel` (Christine Ho) * Added `group` keyword argument to StreamField blocks for grouping related blocks together in the block menu (Andreas Nüßlein) * Update the sitemap generator to use the Django sitemap module (Michael van Tellingen, Mike Dingjan) ### Bug fixes * Marked ‘Date from’ / ‘Date to’ strings in wagtailforms for translation (Vorlif) * “File” field label on image edit form is now translated (Stein Strindhaug) * Unreliable preview is now reliable by always opening in a new window (Kjartan Sverrisson) * Fixed placement of `{{ block.super }}` in `snippets/type_index.html` (LB (Ben Johnston)) * Optimised database queries on group edit page (Ashia Zawaduk) * Choosing a popular search term for promoted search results now works correctly after pagination (Janneke Janssen) * IDs used in tabbed interfaces are now namespaced to avoid collisions with other page elements (Janneke Janssen) * Page title not displaying page name when moving a page (Trent Holliday) * The ModelAdmin module can now work without the wagtailimages and wagtaildocs apps installed (Andy Babic) * Cloudflare error handling now handles non-string error responses correctly (hdnpl) * Search indexing now uses a defined query ordering to prevent objects from being skipped (Christian Peters) * Ensure that number localization is not applied to object IDs within admin templates (Tom Hendrikx) * Paginating with a search present was always returning the 1st page in Internet Explorer 10 & 11 (Ralph Jacobs) * RoutablePageMixin and wagtailforms previews now set the `request.is_preview` flag (Wietze Helmantel) * The save and preview buttons in the page editor are now mobile-friendly (Maarten Kling) * Page links within rich text now respect custom URLs defined on specific page models (Gary Krige, Huub Bouma) * Default avatar no longer visible when using a transparent gravatar image (Thijs Kramer) * Scrolling within the datetime picker is now usable again for touchpads (Ralph Jacobs) * List-based fields within form builder form submissions are now displayed as comma-separated strings rather than as Python lists (Christine Ho, Matt Westcott) * The page type usage listing now have a translatable page title (Ramon de Jezus) * Styles for submission filtering form now have a consistent height. (Thijs Kramer) * Slicing a search result set no longer loses the annotation added by `annotate_score` (Karl Hobley) * String-based primary keys are now escaped correctly in ModelAdmin URLs (Andreas Nüßlein) * Empty search in the API now works (Morgan Aubert) * `RichTextBlock` toolbar now correctly positioned within `StructBlock` (Janneke Janssen) * Fixed display of ManyToMany fields and False values on the ModelAdmin inspect view (Andy Babic) * Prevent pages from being recursively copied into themselves (Matheus Bratfisch) * Specifying the full file name in documents URL is mandatory (Morgan Aubert) * Reordering inline forms now works correctly when moving past a deleted form (Janneke Janssen) * Removed erroneous |safe filter from search results template in project template (Karl Hobley) ## Upgrade considerations ### Django 1.9 and Python 3.3 support dropped Support for Django 1.9 and Python 3.3 has been dropped in this release; please upgrade from these before upgrading Wagtail. Note that the Django 1.8 release series is still supported, as a Long Term Support release. ### Dropped support for generating static sites using `django-medusa` Django-medusa is no longer maintained, and is incompatible with Django 1.8 and above. An alternative module based on the django-bakery package is available as a third-party contribution: [https://github.com/moorinteractive/wagtail-bakery](https://github.com/moorinteractive/wagtail-bakery). ### Signals on custom `Image` and `Rendition` models connected automatically Projects using [custom image models](../advanced_topics/images/custom_image_model.md#custom-image-model) no longer need to set up signal receivers to handle deletion of image files and image feature detection, as these are now handled automatically by Wagtail. The following lines of code should be removed: ```python # Delete the source image file when an image is deleted @receiver(post_delete, sender=CustomImage) def image_delete(sender, instance, **kwargs): instance.file.delete(False) # Delete the rendition image file when a rendition is deleted @receiver(post_delete, sender=CustomRendition) def rendition_delete(sender, instance, **kwargs): instance.file.delete(False) # Perform image feature detection (if enabled) @receiver(pre_save, sender=CustomImage) def image_feature_detection(sender, instance, **kwargs): if not instance.has_focal_point(): instance.set_focal_point(instance.get_suggested_focal_point()) ``` ### Adding / editing users through Wagtail admin no longer sets `is_staff` flag Previously, the `is_staff` flag (which grants access to the Django admin interface) was automatically set for superusers, and reset for other users, when creating and updating users through the Wagtail admin. This behaviour has now been removed, since Wagtail is designed to work independently of the Django admin. If you need to reinstate the old behavior, you can set up a [`pre_save`](https://docs.djangoproject.com/en/stable/ref/signals/#django.db.models.signals.pre_save) signal handler on the User model to set the flag appropriately. ### Specifying the full file name in documents URL is mandatory In previous releases, it was possible to download a document using the primary key and a fraction of its file name, or even without file name. You could get the same document at the addresses `/documents/1/your-file-name.pdf`, `/documents/1/you` & `/documents/1/`. This feature was supposed to allow shorter URLs but was not used in Wagtail. For security reasons, we removed it, so only the full URL works: `/documents/1/your-file-name.pdf` If any of your applications relied on the previous behavior, you will have to rewrite it to take this into account. # 1.11.1.html.md # Wagtail 1.11.1 release notes *July 7, 2017* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes * Custom display page titles defined with `get_admin_display_title` are now shown within the page explorer menu (Matt Westcott, Janneke Janssen) # 1.11.html.md # Wagtail 1.11 release notes *June 30, 2017* > * [What’s new](#what-s-new) > * [Upgrade considerations](#upgrade-considerations) ## What’s new ### Explorer menu built with the admin API and React After more than a year of work, the new explorer menu has finally landed! It comes with the following improvements: * View all pages - not just the ones with child pages. * Better performance, no matter the number of pages or levels in the hierarchy. * Navigate the menu via keyboard. * View Draft pages, and go to page editing, directly from the menu. Beyond features, the explorer is built with the new admin API and React components. This will facilitate further evolutions to make it even faster and user-friendly. This work is the product of `4` Wagtail sprints, and the efforts of `16` people, listed here by order of first involvement: * Karl Hobley (Cape town sprint, admin API) * Josh Barr (Cape town sprint, prototype UI) * Thibaud Colas (Ede sprint, Reykjavík sprint) * Janneke Janssen (Ede sprint, Reykjavík sprint, Wagtail Space sprint) * Rob Moorman (Ede sprint, eslint-config-wagtail, ES6+React+Redux styleguide) * Maurice Bartnig (Ede sprint, i18n and bug fixes) * Jonny Scholes (code review) * Matt Westcott (Reykjavík sprint, refactorings) * Sævar Öfjörð Magnússon (Reykjavík sprint) * Eirikur Ingi Magnusson (Reykjavík sprint) * Harris Lapiroff (Reykjavík sprint, tab-accessible navigation) * Hugo van den Berg (testing, Wagtail Space sprint) * Olly Willans (UI, UX, Wagtail Space sprint) * Andy Babic (UI, UX) * Ben Enright (UI, UX) * Bertrand Bordage (testing, documentation) ### Privacy settings on documents Privacy settings can now be configured on collections, to restrict access to documents either by shared password or by user account. See: [Private pages](../advanced_topics/privacy.md#private-pages). This feature was developed by Ulrich Wagner and Matt Westcott. Thank you to [Wharton Research Data Services](https://www.WhartonWRDS.com/) of [The Wharton School](https://www.wharton.upenn.edu) for sponsoring this feature. ### Other features * Optimised page URL generation by caching site paths in the request scope (Tobias McNulty, Matt Westcott) * The current live version of a page is now tracked on the revision listing view (Matheus Bratfisch) * Each block created in a `StreamField` is now assigned a globally unique identifier (Matt Westcott) * Mixcloud oEmbed pattern has been updated (Alice Rose) * Added `last_published_at` field to the Page model (Matt Westcott) * Added `show_in_menus_default` flag on page models, to allow “show in menus” to be checked by default (LB (Ben Johnston)) * “Copy page” form now validates against copying to a destination where the user does not have permission (Henk-Jan van Hasselaar) * Allows reverse relations in `RelatedFields` for elasticsearch & PostgreSQL search backends (Lucas Moeskops, Bertrand Bordage) * Added oEmbed support for Facebook (Mikalai Radchuk) * Added oEmbed support for Tumblr (Mikalai Radchuk) ### Bug fixes * Unauthenticated AJAX requests to admin views now return 403 rather than redirecting to the login page (Karl Hobley) * `TableBlock` options `afterChange`, `afterCreateCol`, `afterCreateRow`, `afterRemoveCol`, `afterRemoveRow` and `contextMenu` can now be overridden (Loic Teixeira) * The lastmod field returned by wagtailsitemaps now shows the last published date rather than the date of the last draft edit (Matt Westcott) * Document chooser upload form no longer renders container elements for hidden fields (Jeffrey Chau) * Prevented exception when visiting a preview URL without initiating the preview (Paul Kamp) ## Upgrade considerations ### Browser requirements for the new explorer menu The new explorer menu does not support IE8, IE9, and IE10. The fallback experience is a link pointing to the explorer pages. ### Caching of site-level URL information throughout the request cycle The `get_url_parts` and `relative_url` methods on `Page` now accept an optional `request` keyword argument. Additionally, two new methods have been added, `get_url` (analogous to the `url` property) and `get_full_url` (analogous to the `full_url`) property. Whenever possible, these methods should be used instead of the property versions, and the request passed to each method. For example: ```python page_url = my_page.url ``` would become: ```python page_url = my_page.get_url(request=request) ``` This enables caching of underlying site-level URL information throughout the request cycle, thereby significantly reducing the number of cache or SQL queries your site will generate for a given page load. A common use case for these methods is any custom template tag your project may include for generating navigation menus. For more information, please refer to [Page URLs](../topics/pages.md#page-urls). Furthermore, if you have overridden `get_url_parts` or `relative_url` on any of your page models, you will need to update the method signature to support this keyword argument; most likely, this will involve changing the line: ```python def get_url_parts(self): ``` to: ```python def get_url_parts(self, *args, **kwargs): ``` and passing those through at the point where you are calling `get_url_parts` on `super` (if applicable). See also: [`wagtail.models.Page.get_url_parts()`](../reference/models.md#wagtail.models.Page.get_url_parts), [`wagtail.models.Page.get_url()`](../reference/models.md#wagtail.models.Page.get_url), [`wagtail.models.Page.get_full_url()`](../reference/models.md#wagtail.models.Page.get_full_url), and [`wagtail.models.Page.relative_url()`](../reference/models.md#wagtail.models.Page.relative_url) ### “Password required” template for documents This release adds the ability to password-protect documents as well as pages. The template used for the “password required” form is distinct from the one used for pages; if you have previously overridden the default template through the `PASSWORD_REQUIRED_TEMPLATE` setting, you may wish to provide a corresponding template for documents through the setting `DOCUMENT_PASSWORD_REQUIRED_TEMPLATE`. See: [Private pages](../advanced_topics/privacy.md#private-pages) ### Elasticsearch 5.4 is incompatible with `ATOMIC_REBUILD` While not specific to Wagtail 1.11, users of Elasticsearch should be aware that the `ATOMIC_REBUILD` option is not compatible with Elasticsearch 5.4.x due to [a bug in the handling of aliases](https://github.com/elastic/elasticsearch/issues/24644). If you wish to use this feature, please use Elasticsearch 5.3.x or 5.5.x (when available). # 1.12.1.html.md # Wagtail 1.12.1 release notes *August 30, 2017* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes * Prevent home page draft title from displaying as blank (Mikalai Radchuk, Matt Westcott) * Fix regression on styling of preview button with more than one preview mode (Jack Paine) * Enabled translations within date-time chooser widget (Lucas Moeskops) # 1.12.2.html.md # Wagtail 1.12.2 release notes *September 18, 2017* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes * Migration for addition of `Page.draft_title` field is now reversible (Venelin Stoykov) * Fixed failure on application startup when `ManifestStaticFilesStorage` is in use and `collectstatic` has not yet been run (Matt Westcott) * Fixed handling of Vimeo and other oEmbed providers with a format parameter in the endpoint URL (Mitchel Cabuloy) * Fixed regression in rendering save button in wagtail.contrib.settings edit view (Matt Westcott) # 1.12.3.html.md # Wagtail 1.12.3 release notes *November 17, 2017* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes * API listing views no longer fail when no site records are defined (Karl Hobley) * Pinned Django REST Framework to <3.7 to restore Django 1.8 compatibility (Matt Westcott) * Fixed crash in XML sitemap generator when all pages on the site are private (Stein Strindhaug) * Fixed error in Postgres search backend when searching specific fields of a `specific()` Page QuerySet (Bertrand Bordage, Matt Westcott) * Fixed error on Elasticsearch backend when passing a QuerySet as an `__in` filter (Karl Hobley, Matt Westcott) * `__isnull` filters no longer fail on Elasticsearch 5 (Karl Hobley) * Prevented intermittent failures on Postgres search backend when a field is defined as both a `SearchField` and a `FilterField` (Matt Westcott) # 1.12.4.html.md # Wagtail 1.12.4 release notes *July 4, 2018* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes * Fix support of `ATOMIC_REBUILD` for projects with Elasticsearch client `>=1.7.0` (Mikalai Radchuk) * Logging an indexing failure on an object with a non-ASCII representation no longer crashes on Python 2 (Aram Dulyan) * Rich text image chooser no longer skips format selection after a validation error (Matt Westcott) * Null characters in URLs no longer crash the redirect middleware on PostgreSQL (Andrew Crewdson, Matt Westcott) # 1.12.5.html.md # Wagtail 1.12.5 release notes *August 13, 2018* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes * Pin django-taggit to <0.23 to restore Django 1.8 compatibility (Matt Westcott) * Mark Beautiful Soup 4.6.1 as incompatible due to bug in formatting empty elements (Matt Westcott) # 1.12.6.html.md # Wagtail 1.12.6 release notes *August 13, 2018* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes * Pin Beautiful Soup to 4.6.0 due to further regressions in formatting empty elements (Matt Westcott) # 1.12.html.md # Wagtail 1.12 (LTS) release notes *August 21, 2017* > * [What’s new](#what-s-new) > * [Upgrade considerations](#upgrade-considerations) Wagtail 1.12 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 8 months). ## What’s new ### Configurable rich text features The feature set provided by the rich text editor can now be configured on a per-field basis, by passing a `features` keyword argument; for example, a field can be configured to allow bold / italic formatting and links, but not headings or embedded images or media. For further information, see [Limiting features in a rich text field](../advanced_topics/customization/page_editing_interface.md#rich-text-features). This feature was developed by Matt Westcott. ### Improved embed configuration New configuration options for embedded media have been added, to give greater control over how media URLs are converted to embeds, and to make it possible to specify additional media providers beyond the ones built in to Wagtail. For further information, see [Embedded content](../advanced_topics/embeds.md#embedded-content). This feature was developed by Karl Hobley. ### Other features * The admin interface now displays a title of the latest draft (Mikalai Radchuk) * `RoutablePageMixin` now has a default “index” route (Andreas Nüßlein, Matt Westcott) * Added multi-select form field to the form builder (dwasyl) * Improved performance of sitemap generation (Levi Adler) * StreamField now respects the `blank` setting; StreamBlock accepts a `required` setting (Loic Teixeira) * StreamBlock now accepts `min_num`, `max_num` and `block_counts` settings to control the minimum and maximum numbers of blocks (Edwar Baron, Matt Westcott) * Users can no longer remove their own active / superuser flags through Settings -> Users (Stein Strindhaug, Huub Bouma) * The `process_form_submission` method of form pages now return the created form submission object (Christine Ho) * Added `WAGTAILUSERS_PASSWORD_ENABLED` and `WAGTAILUSERS_PASSWORD_REQUIRED` settings to permit creating users with no Django-side passwords, to support external authentication setups (Matt Westcott) * Added help text parameter to `DecimalBlock` and `RegexBlock` (Tomasz Knapik) * Optimised caudal oscillation parameters on logo (Jack Paine) ### Bug fixes * FieldBlocks in StreamField now call the field’s `prepare_value` method (Tim Heap) * Initial disabled state of InlinePanel add button is now set correctly on non-default tabs (Matthew Downey) * Redirects with unicode characters now work (Rich Brennan) * Prevent explorer view from crashing when page model definitions are missing, allowing the offending pages to be deleted (Matt Westcott) * Hide the userbar from printed page representation (Eugene Morozov) * Prevent the page editor footer content from collapsing into two lines unnecessarily (Jack Paine) * StructBlock values no longer render HTML templates as their `str` representation, to prevent infinite loops in debugging / logging tools (Matt Westcott) * Removed deprecated jQuery `load` call from TableBlock initialization (Jack Paine) * Position of options in mobile nav-menu (Jack Paine) * Center page editor footer regardless of screen width (Jack Paine) * Change the design of the navbar toggle icon so that it no longer obstructs page headers (Jack Paine) * Document add/edit forms no longer render container elements for hidden fields (Jeffrey Chau) ## Upgrade considerations ### StreamField now defaults to `blank=False` StreamField now respects the `blank` field setting; when this is false, at least one block must be supplied for the field to pass validation. To match the behavior of other model fields, `blank` defaults to `False`; if you wish to allow a StreamField to be left empty, you must now add `blank=True` to the field. When passing an explicit `StreamBlock` as the top-level block of a StreamField definition, note that the StreamField’s `blank` keyword argument always takes precedence over the block’s `required` property, including when it is left as the default value of `blank=False`. Consequently, setting `required=False` on a top-level `StreamBlock` has no effect. ### Old configuration settings for embeds are deprecated The configuration settings `WAGTAILEMBEDS_EMBED_FINDER` and `WAGTAILEMBEDS_EMBEDLY_KEY` have been deprecated in favor of the new `WAGTAILEMBEDS_FINDERS` setting. Please see [Configuring embed “finders”](../advanced_topics/embeds.md#configuring-embed-finders) for the new configuration to use. ### Registering custom hallo.js plugins directly is deprecated The ability to enable / disable `hallo.js` plugins by calling `registerHalloPlugin` or modifying the `halloPlugins` list has been deprecated, and will be removed in Wagtail 1.14. The recommended way of customizing the hallo.js editor is now through [rich text features](../advanced_topics/customization/page_editing_interface.md#rich-text-features). ### Custom `get_admin_display_title` methods should use `draft_title` This release introduces a new `draft_title` field on page models, so that page titles as used across the admin interface will correctly reflect any changes that exist in draft. If any of your page models override the `get_admin_display_title` method, to customize the display of page titles in the admin, it is recommended that you now update these to base their output on `draft_title` rather than `title`. Alternatively, to preserve backwards compatibility, you can invoke `super` on the method, for example: ```python def get_admin_display_title(self): return "%(title)s (%(lang)s)" % { 'title': super(TranslatablePage, self).get_admin_display_title(), 'lang': self.language_code, } ``` ### Fixtures for loading pages should include `draft_title` In most situations, the new `draft_title` field on page models will automatically be populated from the page title. However, this is not the case for pages that are created from fixtures. Projects that use fixtures to load initial data should therefore ensure that a `draft_title` field is specified. ### `RoutablePageMixin` now has a default index route If you’ve used `RoutablePageMixin` on a Page model, you may have had to manually define an index route to serve the page at its main URL (`r'^$'`) so it behaves like a normal page. Wagtail now defines a default index route so this is no longer required. # 1.13.1.html.md # Wagtail 1.13.1 release notes *November 17, 2017* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes * API listing views no longer fail when no site records are defined (Karl Hobley) * Fixed crash in XML sitemap generator when all pages on the site are private (Stein Strindhaug) * Fixed incorrect z-index on userbar causing it to appear behind page content (Stein Strindhaug) * Fixed error in Postgres search backend when searching specific fields of a `specific()` Page QuerySet (Bertrand Bordage, Matt Westcott) * Fixed error on Elasticsearch backend when passing a QuerySet as an `__in` filter (Karl Hobley, Matt Westcott) * `__isnull` filters no longer fail on Elasticsearch 5 (Karl Hobley) * Prevented intermittent failures on Postgres search backend when a field is defined as both a `SearchField` and a `FilterField` (Matt Westcott) # 1.13.2.html.md # Wagtail 1.13.2 release notes *July 4, 2018* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes * Fix support of `ATOMIC_REBUILD` for projects with Elasticsearch client `>=1.7.0` (Mikalai Radchuk) * Logging an indexing failure on an object with a non-ASCII representation no longer crashes on Python 2 (Aram Dulyan) * Rich text image chooser no longer skips format selection after a validation error (Matt Westcott) * Null characters in URLs no longer crash the redirect middleware on PostgreSQL (Matt Westcott) # 1.13.3.html.md # Wagtail 1.13.3 release notes *August 13, 2018* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes * Pin django-taggit to <0.23 to restore Django 1.8 compatibility (Matt Westcott) * Mark Beautiful Soup 4.6.1 as incompatible due to bug in formatting empty elements (Matt Westcott) # 1.13.4.html.md # Wagtail 1.13.4 release notes *August 13, 2018* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes * Pin Beautiful Soup to 4.6.0 due to further regressions in formatting empty elements (Matt Westcott) # 1.13.html.md # Wagtail 1.13 (LTS) release notes *October 16, 2017* > * [What’s new](#what-s-new) Wagtail 1.13 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 8 months). Please note that Wagtail 1.13 will be the last LTS release to support Python 2. ## What’s new ### New features * Front-end cache invalidator now supports purging URLs as a batch - see [Invalidating URLs](../reference/contrib/frontendcache.md#frontend-cache-invalidating-urls) (Karl Hobley) * [Custom document model](../advanced_topics/documents/custom_document_model.md) is now documented (Emily Horsman) * Use minified versions of CSS in the admin by adding minification to the front-end tooling (Vincent Audebert, Thibaud Colas) * Wagtailforms serve view now passes `request.FILES`, for use in custom form handlers (LB (Ben Johnston)) * Documents and images are now given new filenames on re-uploading, to avoid old versions being kept in cache (Bertrand Bordage) * Added custom 404 page for admin interface (Jack Paine) * Breadcrumb navigation now uses globe icon to indicate tree root, rather than home icon (Matt Westcott) * Wagtail now uses React 15.6.2 and above, released under the MIT license (Janneke Janssen) * User search in the Wagtail admin UI now works across multiple fields (Will Giddens) * `Page.last_published_at` is now a filterable field for search (Mikalai Radchuk) * Page search results and usage listings now include navigation links (Matt Westcott) ### Bug fixes * “Open Link in New Tab” on a right arrow in page explorer should open page list (Emily Horsman) * Using `order_by_relevance=False` when searching with PostgreSQL now works (Mitchel Cabuloy) * Inline panel first and last sorting arrows correctly hidden in non-default tabs (Matt Westcott) * `WAGTAILAPI_LIMIT_MAX` now accepts None to disable limiting (jcronyn) * In PostgreSQL, new default ordering when ranking of objects is the same (Bertrand Bordage) * Fixed overlapping header elements on form submissions view on mobile (Jack Paine) * Fixed avatar position in footer on mobile (Jack Paine) * Custom document models no longer require their own post-delete signal handler (Gordon Pendleton) * Deletion of image / document files now only happens when database transaction has completed (Gordon Pendleton) * Fixed Node build scripts to work on Windows (Mikalai Radchuk) * Stop breadcrumb home icon from showing as ellipsis in Chrome 60 (Matt Westcott) * Prevent `USE_THOUSAND_SEPARATOR = True` from breaking the image focal point chooser (Sævar Öfjörð Magnússon) * Removed deprecated `SessionAuthenticationMiddleware` from project template (Samir Shah) * Custom display page titles defined with `get_admin_display_title` are now shown in search results (Ben Sturmfels, Matt Westcott) * Custom PageManagers now return the correct PageQuerySet subclass (Matt Westcott) # 1.2.html.md # Wagtail 1.2 release notes *November 12, 2015* > * [What’s new](#what-s-new) > * [Upgrade considerations](#upgrade-considerations) ## What’s new ### Site settings module Wagtail now includes a contrib module (previously available as the [wagtailsettings](https://pypi.python.org/pypi/wagtailsettings/) package) to allow administrators to edit site-specific settings. See: [Settings models](../reference/contrib/settings.md) ### Jinja2 support The core templatetags (`pageurl`, `slugurl`, `image`, `richtext` and `wagtailuserbar`) are now compatible with Jinja2 so it’s now possible to use Jinja2 as the template engine for your Wagtail site. Note that the variable name `self` is reserved in Jinja2, and so Wagtail now provides alternative variable names where `self` was previously used: `page` to refer to page objects, and `value` to refer to StreamField blocks. All code examples in this documentation have now been updated to use the new variable names, for compatibility with Jinja2; however, users of the default Django template engine can continue to use `self`. See: [Jinja2 template support](../reference/jinja2.md) ### Site-specific redirects You can now create redirects for a particular site using the admin interface. ### Search API improvements Wagtail’s image and document models now provide a `search` method on their QuerySets, making it easy to perform searches on filtered data sets. In addition, search methods now accept two new keyword arguments: * `operator`, to determine whether multiple search terms will be treated as ‘or’ (any term may match) or ‘and’ (all terms must match); * `order_by_relevance`, set to True (the default) to order by relevance or False to preserve the QuerySet’s original ordering. See: [Searching](../topics/search/searching.md#wagtailsearch-searching) ### `max_num` and `min_num` parameters on inline panels Inline panels now accept the optional parameters `max_num` and `min_num`, to specify the maximum / minimum number of child items that must exist for the page to be valid. See: [InlinePanel](../reference/panels.md#inline-panels) ### `get_context` on StreamField blocks StreamField blocks now [provide a get_context method](../topics/streamfield.md#streamfield-get-context) that can be overridden to pass additional variables to the block’s template. ### Browsable API The Wagtail API now incorporates the browsable front-end provided by Django REST Framework. Note that this must be enabled by adding `'rest_framework'` to your project’s `INSTALLED_APPS` setting. ### Python 3.5 support Wagtail now supports Python 3.5 when run in conjunction with Django 1.8.6 or later. ### Minor features * WagtailRedirectMiddleware can now ignore the query string if no redirect exactly matches it * Order of URL parameters now ignored by redirect middleware * Added SQL Server compatibility to image migration * Added `class` attributes to Wagtail rich text editor buttons to aid custom styling * Simplified body_class in default homepage template * page_published signal now called with the revision object that was published * Added a favicon to the admin interface, customizable by overriding the `branding_favicon` block (see [Custom branding](../advanced_topics/customization/admin_templates.md#custom-branding)). * Added spinner animations to long-running form submissions * The EMBEDLY_KEY setting has been renamed to WAGTAILEMBEDS_EMBEDLY_KEY * StreamField blocks are now added automatically, without showing the block types menu, if only one block type exists (Alex Gleason) * The `first_published_at` and `latest_revision_created_at` fields on page models are now available as filter fields on search queries * Wagtail admin now standardizes on a single thumbnail image size, to reduce the overhead of creating multiple renditions * Rich text fields now strip out HTML comments * Page editor form now sets `enctype="multipart/form-data"` as appropriate, allowing FileField to be used on page models (Petr Vacha) * Explorer navigation menu on an empty page tree now takes you to the root level, rather than doing nothing * Added animation and fixed display issues when focusing a rich text field (Alex Gleason) * Added a system check to warn if Pillow is compiled without JPEG / PNG support * Page chooser now prevents users from selecting the root node where this would be invalid * New translations for Dutch (Netherlands), Georgian, Swedish and Turkish (Turkey) ### Bug fixes * Page slugs are no longer auto-updated from the page title if the page is already published * Deleting a page permission from the groups admin UI does not immediately submit the form * Wagtail userbar is shown on pages that do not pass a `page` variable to the template (e.g. because they override the `serve` method) * `request.site` now set correctly on page preview when the page is not in the default site * Project template no longer raises a deprecation warning (Maximilian Stauss) * `PageManager.sibling_of(page)` and `PageManager.not_sibling_of(page)` now default to inclusive (i.e. `page` is considered a sibling of itself), for consistency with other sibling methods * The “view live” button displayed after publishing a page now correctly reflects any changes made to the page slug (Ryan Pineo) * API endpoints now accept and ignore the `_` query parameter used by jQuery for cache-busting * Page slugs are no longer cut off when Unicode characters are expanded into multiple characters (Sævar Öfjörð Magnússon) * Searching a specific page model while filtering it by either ID or tree position no longer raises an error (Ashia Zawaduk) * Scrolling an over-long explorer menu no longer causes white background to show through (Alex Gleason) * Removed jitter when hovering over StreamField blocks (Alex Gleason) * Non-ASCII email addresses no longer throw errors when generating Gravatar URLs (Denis Voskvitsov, Kyle Stratis) * Dropdown for `ForeignKey` s are now styled consistently (Ashia Zawaduk) * Date choosers now appear on top of StreamField menus (Sergey Nikitin) * Fixed a migration error that was raised when block-updating from 0.8 to 1.1+ * [`wagtail.models.Page.copy()`](../reference/models.md#wagtail.models.Page.copy) no longer breaks on models with a `ClusterTaggableManager` or `ManyToManyField` * Validation errors when inserting an embed into a rich text area are now reported back to the editor ## Upgrade considerations ### `PageManager.sibling_of(page)` and `PageManager.not_sibling_of(page)` have changed behaviour In previous versions of Wagtail, the `sibling_of` and `not_sibling_of` methods behaved inconsistently depending on whether they were called on a manager (e.g. `Page.objects.sibling_of(some_page)` or `EventPage.objects.sibling_of(some_page)`) or a QuerySet (e.g. `Page.objects.all().sibling_of(some_page)` or `EventPage.objects.live().sibling_of(some_page)`). Previously, the manager methods behaved as *exclusive* by default; that is, they did not count the passed-in page object as a sibling of itself: ```python >>> event_1 = EventPage.objects.get(title='Event 1') >>> EventPage.objects.sibling_of(event_1) [] # OLD behavior: Event 1 is not considered a sibling of itself ``` This has now been changed to be *inclusive* by default; that is, the page is counted as a sibling of itself: ```python >>> event_1 = EventPage.objects.get(title='Event 1') >>> EventPage.objects.sibling_of(event_1) [, ] # NEW behavior: Event 1 is considered a sibling of itself ``` If the call to `sibling_of` or `not_sibling_of` is chained after another QuerySet method - such as `all()`, `filter()` or `live()` - behaviour is unchanged; this behaves as *inclusive*, as it did in previous versions: ```python >>> event_1 = EventPage.objects.get(title='Event 1') >>> EventPage.objects.all().sibling_of(event_1) [, ] # OLD and NEW behaviour ``` If your project includes queries that rely on the old (exclusive) behavior, this behavior can be restored by adding the keyword argument `inclusive=False`: ```python >>> event_1 = EventPage.objects.get(title='Event 1') >>> EventPage.objects.sibling_of(event_1, inclusive=False) [] # passing inclusive=False restores the OLD behaviour ``` ### `Image.search` and `Document.search` methods are deprecated The `Image.search` and `Document.search` methods have been deprecated in favor of the new QuerySet-based search mechanism - see [Searching Images, Documents and custom models](../topics/search/searching.md#wagtailsearch-images-documents-custom-models). Code using the old `search` methods should be updated to search on QuerySets instead; for example: ```python Image.search("Hello", filters={'uploaded_by_user': user}) ``` can be rewritten as: ```python Image.objects.filter(uploaded_by_user=user).search("Hello") ``` ### Wagtail API requires adding `rest_framework` to INSTALLED_APPS If you have the Wagtail API (`wagtail.contrib.wagtailapi`) enabled, you must now add `'rest_framework'` to your project’s `INSTALLED_APPS` setting. In the current version the API will continue to function without this app, but the browsable front-end will not be available; this ability will be dropped in a future release. ### `Page.get_latest_revision_as_page()` now returns live page object when there are no draft changes If you have any application code that makes direct updates to page data, at the model or database level, be aware that the way these edits are reflected in the page editor has changed. Previously, the `get_latest_revision_as_page` method - used by the page editor to return the current page revision for editing - always retrieved data from the page’s revision history. Now, it will only do so if the page has unpublished changes (i.e. the page is in `live + draft` state) - pages that have received no draft edits since being published will return the page’s live data instead. As a result, any changes made directly to a live page object will be immediately reflected in the editor without needing to update the latest revision record (but note, the old behavior is still used for pages in `live + draft` state). # 1.3.1.html.md # Wagtail 1.3.1 release notes *January 5, 2016* > * [What’s changed](#what-s-changed) ## What’s changed ### Bug fixes * Applied workaround for failing `wagtailimages` migration on Django 1.8.8 / 1.9.1 with Postgres (see [Django issue #26034](https://code.djangoproject.com/ticket/26034)) # 1.3.html.md # Wagtail 1.3 release notes *December 23, 2015* > * [What’s new](#what-s-new) > * [Upgrade considerations](#upgrade-considerations) ## What’s new ### Django 1.9 support Wagtail is now compatible with Django 1.9. ### Indexing fields across relations in Elasticsearch Fields on related objects can now be indexed in Elasticsearch using the new `indexed.RelatedFields` declaration type: ```python class Book(models.Model, index.Indexed): ... search_fields = [ index.SearchField('title'), index.FilterField('published_date'), index.RelatedFields('author', [ index.SearchField('name'), index.FilterField('date_of_birth'), ]), ] # Search books where their author was born after 1950 # Both the book title and the author's name will be searched >>> Book.objects.filter(author__date_of_birth__gt=date(1950, 1, 1)).search("Hello") ``` See: [RelatedFields](../topics/search/indexing.md#wagtailsearch-index-relatedfields) ### Cross-linked admin search UI The search interface in the Wagtail admin now includes a toolbar to quickly switch between different search types - pages, images, documents and users. A new [register_admin_search_area](../reference/hooks.md#register-admin-search-area) hook is provided for adding new search types to this toolbar. ### Minor features * Added `WagtailPageTests`, a helper module to simplify writing tests for Wagtail sites. See [Testing your Wagtail site](../advanced_topics/testing.md) * Added system checks to check the `subpage_types` and `parent_page_types` attributes of page models * Added `WAGTAIL_PASSWORD_RESET_ENABLED` setting to allow password resets to be disabled independently of the password management interface (John Draper) * Submit for moderation notification emails now include the editor name (Denis Voskvitsov) * Updated fonts for more comprehensive Unicode support * Added `.alt` attribute to image renditions * The default `src`, `width`, `height` and `alt` attributes can now be overridden by attributes passed to the `{% image %}` tag * Added keyboard shortcuts for preview and save in the page editor * Added `Page` methods `can_exist_under`, `can_create_at`, `can_move_to` for customizing page type business rules * `wagtailadmin.utils.send_mail` now passes extra keyword arguments to Django’s `send_mail` function (Matthew Downey) * `page_unpublish` signal is now fired for each page that was unpublished by a call to `PageQuerySet.unpublish()` * Add `get_upload_to` method to `AbstractImage`, to allow overriding the default image upload path (Ben Emery) * Notification emails are now sent per user (Matthew Downey) * Added the ability to override the default manager on Page models * Added an optional human-friendly `site_name` field to sites (Timo Rieber) * Added a system check to warn developers who use a custom Wagtail build but forgot to build the admin css * Added success message after updating image from the image upload view (Christian Peters) * Added a `request.is_preview` variable for templates to distinguish between previewing and live (Denis Voskvitsov) * ‘Pages’ link on site stats dashboard now links to the site homepage when only one site exists, rather than the root level * Added support for chaining multiple image operations on the `{% image %}` tag (Christian Peters) * New translations for Arabic, Latvian and Slovak ### Bug fixes * Images and page revisions created by a user are no longer deleted when the user is deleted (Rich Atkinson) * HTTP cache purge now works again on Python 2 (Mitchel Cabuloy) * Locked pages can no longer be unpublished (Alex Bridge) * Site records now implement `get_by_natural_key` * Creating pages at the root level (and any other instances of the base `Page` model) now properly respects the `parent_page_types` setting * Settings menu now opens correctly from the page editor and styleguide views * `subpage_types` / `parent_page_types` business rules are now enforced when moving pages * Multi-word tags on images and documents are now correctly preserved as a single tag (LKozlowski) * Changed verbose names to start with lower case where necessary (Maris Serzans) * Invalid images no longer crash the image listing (Maris Serzans) * `MenuItem` `url` parameter can now take a lazy URL (Adon Metcalfe, rayrayndwiga) * Added missing translation tag to InlinePanel ‘Add’ button (jnns) * Added missing translation tag to ‘Signing in…’ button text (Eugene MechanisM) * Restored correct highlighting behavior of rich text toolbar buttons * Rendering a missing image through ImageChooserBlock no longer breaks the whole page (Christian Peters) * Filtering by popular tag in the image chooser now works when using the database search backend ## Upgrade considerations ### Jinja2 template tag modules have changed location Due to a change in the way template tags are imported in Django 1.9, it has been necessary to move the Jinja2 template tag modules from “templatetags” to a new location, “jinja2tags”. The correct configuration settings to enable Jinja2 templates are now as follows: ```python TEMPLATES = [ # ... { 'BACKEND': 'django.template.backends.jinja2.Jinja2', 'APP_DIRS': True, 'OPTIONS': { 'extensions': [ 'wagtail.core.jinja2tags.core', 'wagtail.wagtailadmin.jinja2tags.userbar', 'wagtail.wagtailimages.jinja2tags.images', ], }, } ] ``` See: [Jinja2 template support](../reference/jinja2.md) ### ContentType-returning methods in wagtailcore are deprecated The following internal functions and methods in `wagtail.wagtailcore.models`, which return a list of `ContentType` objects, have been deprecated. Any uses of these in your code should be replaced by the corresponding new function which returns a list of model classes instead: * `get_page_types()` - replaced by `get_page_models()` * `Page.clean_subpage_types()` - replaced by `Page.clean_subpage_models()` * `Page.clean_parent_page_types()` - replaced by `Page.clean_parent_page_models()` * `Page.allowed_parent_page_types()` - replaced by `Page.allowed_parent_page_models()` * `Page.allowed_subpage_types()` - replaced by `Page.allowed_subpage_models()` In addition, note that these methods now return page types that are marked as `is_creatable = False`, including the base `Page` class. (Abstract models are not included, as before.) # 1.4.1.html.md # Wagtail 1.4.1 release notes *March 17, 2016* > * [What’s changed](#what-s-changed) ## What’s changed ### Bug fixes * Fixed erroneous rendering of up arrow icons (Rob Moorman) # 1.4.2.html.md # Wagtail 1.4.2 release notes *March 1, 2016* > * [What’s changed](#what-s-changed) ## What’s changed ### Bug fixes * Streamfields no longer break on validation error * Number of validation errors in each tab in the editor is now correctly reported again * Userbar now opens on devices with both touch and mouse (Josh Barr) * `wagtail.wagtailadmin.wagtail_hooks` no longer calls `static` during app load, so you can use `ManifestStaticFilesStorage` without calling the `collectstatic` command * Fixed crash on page save when a custom `Page` edit handler has been specified using the `edit_handler` attribute (Tim Heap) # 1.4.3.html.md # Wagtail 1.4.3 release notes *April 4, 2016* > * [What’s changed](#what-s-changed) ## What’s changed ### Bug fixes * Fixed regression introduced in 1.4.2 which caused Wagtail to query the database during a system check (Tim Heap) # 1.4.4.html.md # Wagtail 1.4.4 release notes *May 10, 2016* > * [What’s changed](#what-s-changed) ## What’s changed ### Translations * New translation for Slovenian (Mitja Pagon) ### Bug fixes * The `wagtailuserbar` template tag now gracefully handles situations where the `request` object is not in the template context (Matt Westcott) * Meta classes on StreamField blocks now handle multiple inheritance correctly (Tim Heap) * Now user can upload images / documents only into permitted collection from choosers * Keyboard shortcuts for save / preview on the page editor no longer incorrectly trigger the “unsaved changes” message (Jack Paine / Matt Westcott) * Redirects no longer fail when both a site-specific and generic redirect exist for the same URL path (Nick Smith, João Luiz Lorencetti) * Wagtail now checks that Group is registered with the Django admin before unregistering it (Jason Morrison) * Previewing inaccessible pages no longer fails with `ALLOWED_HOSTS = ['*']` (Robert Rollins) * The submit button ‘spinner’ no longer activates if the form has client-side validation errors (Jack Paine, Matt Westcott) * Overriding `MESSAGE_TAGS` in project settings no longer causes messages in the Wagtail admin to lose their styling (Tim Heap) * Border added around explorer menu to stop it blending in with StreamField block listing; also fixes invisible explorer menu in Firefox 46 (Alex Gleason) # 1.4.5.html.md # Wagtail 1.4.5 release notes *May 19, 2016* > * [What’s changed](#what-s-changed) ## What’s changed ### Bug fixes * Paste / drag operations done entirely with the mouse are now correctly picked up as edits within the rich text editor (Matt Fozard) * Logic for canceling the “unsaved changes” check on form submission has been fixed to work cross-browser (Stephen Rice) * The “unsaved changes” confirmation was erroneously shown on IE / Firefox when previewing a page with validation errors (Matt Westcott) * The up / down / delete controls on the “Promoted search results” form no longer trigger a form submission (Matt Westcott) * Opening preview window no longer performs user-agent sniffing, and now works correctly on IE11 (Matt Westcott) * Tree paths are now correctly assigned when previewing a newly-created page underneath a parent with deleted children (Matt Westcott) * Added BASE_URL setting back to project template * Clearing the search box in the page chooser now returns the user to the browse view (Matt Westcott) * The above fix also fixed an issue where Internet Explorer got stuck in the search view upon opening the page chooser (Matt Westcott) # 1.4.6.html.md # Wagtail 1.4.6 release notes *July 18, 2016* > * [What’s changed](#what-s-changed) ## What’s changed ### Bug fixes * Pin html5lib to version 0.999999 to prevent breakage caused by internal API changes (Liam Brenner) # 1.4.html.md # Wagtail 1.4 (LTS) release notes *March 16, 2016* > * [What’s new](#what-s-new) > * [Upgrade considerations](#upgrade-considerations) Wagtail 1.4 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 8 months). ## What’s new ### Page revision management ![image](_static/images/releasenotes_1_4_revision-ui.png) From the page editing interface, editors can now access a list of previous revisions of the page, and preview or roll back to any earlier revision. ### Collections for image / document organization Images and documents can now be organized into collections, set up by administrators through the Settings -> Collections menu item. User permissions can be set either globally (on the ‘Root’ collection) or on individual collections, allowing different user groups to keep their media items separated. Thank you to the University of South Wales for sponsoring this feature. ### Redesigned userbar ![image](_static/images/releasenotes_1_4_userbar-corner.png) The Wagtail userbar (which gives editors quick access to the admin from the site frontend) has been redesigned, and no longer depends on an iframe. The new design allows more flexibility in label text, more configurable positioning to avoid overlapping with site navigation, and adds a new “Show in Explorer” option. This feature was developed by Thomas Winter and Gareth Price. ### Protection against unsaved changes The page editor interface now produces a warning if the user attempts to navigate away while there are unsaved changes. ### Multiple document uploader The “Add a document” interface now supports uploading multiple documents at once, in the same way as uploading images. ### Custom document models The `Document` model can now be overridden using the new `WAGTAILDOCS_DOCUMENT_MODEL` setting. This works in the same way that `WAGTAILIMAGES_IMAGE_MODEL` works for `Image`. ### Removed django-compressor dependency Wagtail no longer depends on the [django-compressor](https://django-compressor.readthedocs.org/) library. While we highly recommend compressing and bundling the CSS and JavaScript on your sites, using django-compressor places additional installation and configuration demands on the developer, so this has now been made optional. ### Minor features * The page search interface now searches all fields instead of just the title (Kait Crawford) * Snippets now support a custom `edit_handler` property; this can be used to implement a tabbed interface, for example. See [Customizing the tabbed interface](../advanced_topics/customization/page_editing_interface.md#customizing-the-tabbed-interface) (Mikalai Radchuk) * Date/time pickers now respect the locale’s ‘first day of week’ setting (Peter Quade) * Refactored the way forms are constructed for the page editor, to allow custom forms to be used * Notification message on publish now indicates whether the page is being published now or scheduled for publication in future (Chris Rogers) * Server errors when uploading images / documents through the chooser modal are now reported back to the user (Nigel Fletton) * Added a hook [insert_global_admin_css](../reference/hooks.md#insert-global-admin-css) for inserting custom CSS throughout the admin backend (Tom Dyson) * Added a hook [construct_explorer_page_queryset](../reference/hooks.md#construct-explorer-page-queryset) for customizing the set of pages displayed in the page explorer * Page models now perform field validation, including testing slugs for uniqueness within a parent page, at the model level on saving * Page slugs are now auto-generated at the model level on page creation if one has not been specified explicitly * The `Page` model now has two new methods `get_site()` and `get_url_parts()` to aid with customizing the page URL generation logic * Upgraded jQuery to 2.2.1 (Charlie Choiniere) * Multiple homepage summary items (`construct_homepage_summary_items` hook) now better vertically spaced (Nicolas Kuttler) * Email notifications can now be sent in HTML format. See [WAGTAILADMIN_USER_PASSWORD_RESET_FORM](../reference/settings.md#email-notifications) (Mike Dingjan) * `StreamBlock` now has provision for throwing non-field-specific validation errors * Wagtail now works with Willow 0.3, which supports auto-correcting the orientation of images based on EXIF data * New translations for Hungarian, Swedish (Sweden) and Turkish ### Bug fixes * Custom page managers no longer raise an error when used on an abstract model * Wagtail’s migrations are now all reversible (Benjamin Bach) * Deleting a page content type now preserves existing pages as basic Page instances, to prevent tree corruption * The `Page.path` field is now explicitly given the “C” collation on PostgreSQL to prevent tree ordering issues when using a database created with the Slovak locale * Wagtail’s compiled static assets are now put into the correct directory on Windows (Aarni Koskela) * `ChooserBlock` now correctly handles models with primary keys other than `id` (alexpilot11) * Fixed typo in Wistia oEmbed pattern (Josh Hurd) * Added more accurate help text for the Administrator flag on user accounts (Matt Fozard) * Tags added on the multiple image uploader are now saved correctly * Documents created by a user are no longer deleted when the user is deleted * Fixed a crash in `RedirectMiddleware` when a middleware class before `SiteMiddleware` returns a response (Josh Schneier) * Fixed error retrieving the moderator list on pages that are covered by multiple moderator permission records (Matt Fozard) * Ordering pages in the explorer by reverse ‘last updated’ time now puts pages with no revisions at the top * WagtailTestUtils now works correctly on custom user models without a `username` field (Adam Bolfik) * Logging in to the admin as a user with valid credentials but no admin access permission now displays an error message, rather than rejecting the user silently * StreamBlock HTML rendering now handles non-ASCII characters correctly on Python 2 (Mikalai Radchuk) * Fixed a bug preventing pages with a `OneToOneField` from being copied (Liam Brenner) * SASS compilation errors during Wagtail development no longer cause exit of Gulp process, instead throws error to console and continues (Thomas Winter) * Explorer page listing now uses specific page models, so that custom URL schemes defined on Page subclasses are respected * Made settings menu clickable again in Firefox 46.0a2 (Juha Kujala) * User management index view no longer assumes the presence of `username`, `first_name`, `last_name` and `email` fields on the user model (Eirik Krogstad) ## Upgrade considerations ### Removal of django-compressor As Wagtail no longer installs django-compressor automatically as a dependency, you may need to make changes to your site’s configuration when upgrading. If your project is actively using django-compressor (that is, your site templates contain `{% compress %}` tags), you should ensure that your project’s requirements explicitly include django-compressor, rather than indirectly relying on Wagtail to install it. If you are not actively using django-compressor on your site, you should update your settings file to remove the line `'compressor'` from `INSTALLED_APPS`, and remove `'compressor.finders.CompressorFinder'` from `STATICFILES_FINDERS`. ### Page models now enforce field validation In previous releases, field validation on Page models was only applied at the form level, meaning that creating pages directly at the model level would bypass validation. For example, if `NewsPage` is a Page model with a required `body` field, then code such as: ```python news_page = NewsPage(title="Hello", slug='hello') parent_page = NewsIndex.objects.get() parent_page.add_child(instance=news_page) ``` would create a page that does not comply with the validation rules. This is no longer possible, as validation is now enforced at the model level on `save()` and `save_revision()`; as a result, code that creates pages programmatically (such as unit tests, and import scripts) may need to be updated to ensure that it creates valid pages. # 1.5.1.html.md # Wagtail 1.5.1 release notes *June 7, 2016* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes * When editing a document link in rich text, the document ID is no longer erroneously interpreted as a page ID (Stephen Rice) * Removing embedded media from rich text by mouse click action now gets correctly registered as a change to the field (Loic Teixeira) * Rich text editor is no longer broken in InlinePanels (Matt Westcott, Gagaro) * Rich text editor is no longer broken in settings (Matt Westcott) * Link tooltip now shows correct urls for newly inserted document links (Matt Westcott) * Now page chooser (in a rich text editor) opens up at the link’s parent page, rather than at the page itself (Matt Westcott) * Reverted fix for explorer menu scrolling with page content, as it blocked access to menus that exceed screen height * Image listing in the image chooser no longer becomes unpaginated after an invalid upload form submission (Stephen Rice) * Confirmation message on the ModelAdmin delete view no longer errors if the model’s string representation depends on the primary key (Yannick Chabbert) * Applied correct translation tags for ‘permanent’ / ‘temporary’ labels on redirects (Matt Westcott) # 1.5.2.html.md # Wagtail 1.5.2 release notes *June 8, 2016* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes * Fixed regression in 1.5.1 on editing external links (Stephen Rice) # 1.5.3.html.md # Wagtail 1.5.3 release notes *July 18, 2016* > * [What’s changed](#what-s-changed) ## What’s changed ### Bug fixes * Pin html5lib to version 0.999999 to prevent breakage caused by internal API changes (Liam Brenner) # 1.5.html.md # Wagtail 1.5 release notes *May 1, 2016* > * [What’s new](#what-s-new) > * [Upgrade considerations](#upgrade-considerations) ## What’s new ### Reorganized page explorer actions ![image](_static/images/releasenotes_1_5_explorermenu.png) The action buttons on the page explorer have been reorganized to reduce clutter, and lesser-used actions have been moved to a “More” dropdown. A new hook [register_page_listing_buttons](../reference/hooks.md#register-page-listing-buttons) has been added for adding custom action buttons to the page explorer. ### ModelAdmin Wagtail now includes an app `wagtail.contrib.modeladmin` (previously available separately as the [wagtailmodeladmin](https://github.com/rkhleics/wagtailmodeladmin) package) which allows you to configure arbitrary Django models to be listed, added and edited through the Wagtail admin. ![image](_static/images/releasenotes_1_5_modeladmin.png) This feature was developed by Andy Babic. ### TableBlock `TableBlock`, a new StreamField block type for editing table-based content, is now available through the `wagtail.contrib.table_block` module. ![image](_static/images/screen40_table_block.png) See [TableBlock](../reference/contrib/table_block.md) for documentation. This feature was developed by Moritz Pfeiffer, David Seddon and Brad Busenius. ### Improved link handling in rich text ![image](_static/images/releasenotes_1_5_unlink.*) The user experience around inserting, editing and removing links inside rich text areas has been greatly improved: link destinations are shown as tooltips, and existing links can be edited as well as unlinked. This feature was developed by Loic Teixeira. ### Improvements to the “Image serve view” [Dynamic image serve view](../advanced_topics/images/image_serve_view.md#using-images-outside-wagtail) This view, which is used for requesting image thumbnails from an external app, has had some improvements made to it in this release. - A [“redirect” action](../advanced_topics/images/image_serve_view.md#image-serve-view-redirect-action) has been added which will redirect the user to where the resized image is hosted rather than serving it from the app. This may be beneficial for performance if the images are hosted externally (eg, S3) - It now takes an optional extra path component which can be used for appending a filename to the end of the URL - The key is now configurable on the view so you don’t have to use your project’s `SECRET_KEY` - It’s been refactored into a class based view and you can now create multiple serve views with different image models and/or keys - It now supports [serving image files using django-sendfile](../advanced_topics/images/image_serve_view.md#image-serve-view-sendfile) (Thanks to Yannick Chabbert for implementing this) ### Minor features * Password reset email now reminds the user of their username (Matt Westcott) * Added jinja2 support for the `settings` template tag (Tim Heap) * Added ‘revisions’ action to pages list (Roel Bruggink) * Added a hook [insert_global_admin_js](../reference/hooks.md#insert-global-admin-js) for inserting custom JavaScript throughout the admin backend (Tom Dyson) * Recognise instagram embed URLs with `www` prefix (Matt Westcott) * The type of the `search_fields` attribute on `Page` models (and other searchable models) has changed from a tuple to a list (see upgrade consideration below) (Tim Heap) * Use PasswordChangeForm when user changes their password, requiring the user to enter their current password (Matthijs Melissen) * Highlight current day in date picker (Jonas Lergell) * Eliminated the deprecated `register.assignment_tag` on Django 1.9 (Josh Schneier) * Increased size of Save button on site settings (Liam Brenner) * Optimised Site.find_for_request to only perform one database query (Matthew Downey) * Notification messages on creating / editing sites now include the site name if specified (Chris Rogers) * Added `--schema-only` option to `update_index` management command * Added meaningful default icons to `StreamField` blocks (Benjamin Bach) * Added title text to action buttons in the page explorer (Liam Brenner) * Changed project template to explicitly import development settings via `settings.dev` (Tomas Olander) * Improved L10N and I18N for revisions list (Roel Bruggink) * The multiple image uploader now displays details of server errors (Nigel Fletton) * Added `WAGTAIL_APPEND_SLASH` setting to determine whether page URLs end in a trailing slash - see [Append Slash](../reference/settings.md#append-slash) (Andrew Tork Baker) * Added auto resizing text field, richtext field, and snippet chooser to styleguide (Liam Brenner) * Support field widget media inside `StreamBlock` blocks (Karl Hobley) * Spinner was added to Save button on site settings (Liam Brenner) * Added success message after logout from Admin (Liam Brenner) * Added `get_upload_to` method to `AbstractRendition` which, when overridden, allows control over where image renditions are stored (Rob Moggach and Matt Westcott) * Added a mechanism to customize the add / edit user forms for custom user models - see [Custom user models](../advanced_topics/customization/custom_user_models.md) (Nigel Fletton) * Added internal provision for swapping in alternative rich text editors (Karl Hobley) ### Bug fixes * The currently selected day is now highlighted only in the correct month in date pickers (Jonas Lergell) * Fixed crash when an image without a source file was resized with the “dynamic serve view” * Registered settings admin menu items now show active correctly (Matthew Downey) * Direct usage of `Document` model replaced with `get_document_model` function in `wagtail.contrib.wagtailmedusa` and in `wagtail.contrib.wagtailapi` * Failures on sending moderation notification emails now produce a warning, rather than crashing the admin page outright (Matt Fozard) * All admin forms that could potentially include file upload fields now specify `multipart/form-data` where appropriate (Tim Heap) * REM units in Wagtailuserbar caused incorrect spacing (Vincent Audebert) * Explorer menu no longer scrolls with page content (Vincent Audebert) * `decorate_urlpatterns` now uses `functools.update_wrapper` to keep view names and docstrings (Mario César) * StreamField block controls are no longer hidden by the StreamField menu when prepending a new block (Vincent Audebert) * Removed invalid use of `__` alias that prevented strings getting picked up for translation (Juha Yrjölä) * [Routable pages](../reference/contrib/routablepage.md#routable-page-mixin) without a main view no longer raise a `TypeError` (Bojan Mihelac) * Fixed UnicodeEncodeError in wagtailforms when downloading a CSV for a form containing non-ASCII field labels on Python 2 (Mikalai Radchuk) * Server errors during search indexing on creating / updating / deleting a model are now logged, rather than causing the overall operation to fail (Karl Hobley) * Objects are now correctly removed from search indexes on deletion (Karl Hobley) ## Upgrade considerations ### Buttons in admin now require `class="button"` The Wagtail admin CSS has been refactored for maintainability, and buttons now require an explicit `button` class. (Previously, the styles were applied on all inputs of type `"submit"`, `"reset"` or `"button"`.) If you have created any apps that extend the Wagtail admin with new views / templates, you will need to add this class to all buttons. ### The `search_fields` attribute on models should now be set to a list On searchable models (eg, `Page` or custom `Image` models) the `search_fields` attribute should now be a list instead of a tuple. For example, the following `Page` model: ```python class MyPage(Page): ... search_fields = Page.search_fields + ( indexed.SearchField('body'), ) ``` Should be changed to: ```python class MyPage(Page): ... search_fields = Page.search_fields + [ indexed.SearchField('body'), ] ``` To ease the burden on third-party modules, adding tuples to `Page.search_fields` will still work. But this backwards-compatibility fix will be removed in Wagtail 1.7. ### Elasticsearch backend now defaults to verifying SSL certs Previously, if you used the Elasticsearch backend, configured with the URLS property like: ```python WAGTAILSEARCH_BACKENDS = { 'default': { 'BACKEND': 'wagtail.wagtailsearch.backends.elasticsearch', 'URLS': ['https://example.com/'], } } ``` Elasticsearch would not be configured to verify SSL certificates for HTTPS URLs. This has been changed so that SSL certificates are verified for HTTPS connections by default. If you need the old behavior back, where SSL certificates are not verified for your HTTPS connection, you can configure the Elasticsearch backend with the `HOSTS` option, like so: ```python WAGTAILSEARCH_BACKENDS = { 'default': { 'BACKEND': 'wagtail.wagtailsearch.backends.elasticsearch', 'HOSTS': [{ 'host': 'example.com' 'use_ssl': True, 'verify_certs': False, }], } } ``` See the [Elasticsearch-py documentation](https://elasticsearch-py.readthedocs.org/en/stable/#ssl-and-authentication) for more configuration options. ### Project template now imports `settings.dev` explicitly In previous releases, the project template’s `settings/__init__.py` file was set up to import the development settings (`settings/dev.py`), so that these would be picked up as the default (i.e. whenever a settings module was not specified explicitly). However, in some setups this meant that the development settings were being inadvertently imported in production mode. For this reason, the import in `settings/__init__.py` has now been removed, and commands must now specify `myproject.settings.dev` or `myproject.settings.production` as appropriate; the supporting scripts (such as `manage.py`) have been updated accordingly. As this is a change to the project template, existing projects are not affected; however, if you have any common scripts or configuration files that rely on importing `myproject.settings` as the settings module, these will need to be updated to work on projects created under Wagtail 1.5. # 1.6.1.html.md # Wagtail 1.6.1 release notes *August 26, 2016* > * [What’s new](#what-s-new) > * [Upgrade considerations](#upgrade-considerations) ## What’s new ### Minor features * Added `WAGTAIL_ALLOW_UNICODE_SLUGS` setting to make Unicode support optional in page slugs (Matt Westcott) ### Bug fixes * Wagtail’s middleware classes are now compatible with Django 1.10’s [new-style middleware](https://docs.djangoproject.com/en/stable/releases/1.10/#new-style-middleware) (Karl Hobley) * The [`can_create_at()`](../reference/models.md#wagtail.models.Page.can_create_at) method is now checked in the create page view (Mikalai Radchuk) * Fixed regression on Django 1.10.1 causing Page subclasses to fail to use PageManager (Matt Westcott) * ChoiceBlocks with lazy translations as option labels no longer break Elasticsearch indexing (Matt Westcott) * The page editor no longer fails to load JavaScript files with `ManifestStaticFilesStorage` (Matt Westcott) * Django 1.10 enables client-side validation for all forms by default, but it fails to handle all the nuances of how forms are used in Wagtail. The client-side validation has been disabled for the Wagtail UI (Matt Westcott) ## Upgrade considerations ### Multi-level inheritance and custom managers The inheritance rules for [Custom Page managers](../topics/pages.md#custom-page-managers) have been updated to match Django’s standard behaviour. In the vast majority of scenarios there will be no change. However, in the specific case where a page model with a custom `objects` manager is subclassed further, the subclass will be assigned a plain `Manager` instead of a `PageManager`, and will now need to explicitly override this with a `PageManager` to function correctly: ```python class EventPage(Page): objects = EventManager() class SpecialEventPage(EventPage): # Previously SpecialEventPage.objects would be set to a PageManager automatically; # this now needs to be set explicitly objects = PageManager() ``` # 1.6.2.html.md # Wagtail 1.6.2 release notes *September 2, 2016* > * [What’s changed](#what-s-changed) ## What’s changed ### Bug fixes * Initial values of checkboxes on group permission edit form now are visible on Django 1.10 (Matt Westcott) # 1.6.3.html.md # Wagtail 1.6.3 release notes *September 30, 2016* > * [What’s changed](#what-s-changed) ## What’s changed ### Bug fixes * Restore compatibility with django-debug-toolbar 1.5 (Matt Westcott) * Edits to StreamFields are no longer ignored in page edits on Django >=1.10.1 when a default value exists (Matt Westcott) # 1.6.html.md # Wagtail 1.6 release notes *August 15, 2016* > * [What’s new](#what-s-new) > * [Upgrade considerations](#upgrade-considerations) ## What’s new ### Django 1.10 support Wagtail is now compatible with Django 1.10. Thanks to Mikalai Radchuk and Paul J Stevens for developing this, and to Tim Graham for reviewing and additional Django core assistance. ### `{% include_block %}` tag for improved StreamField template inclusion In previous releases, the standard way of rendering the HTML content of a StreamField was through a simple variable template tag, such as `{{ page.body }}`. This had the drawback that any templates used in the StreamField rendering would not inherit variables from the parent template’s context, such as `page` and `request`. To address this, a new template tag `{% include_block page.body %}` has been introduced as the new recommended way of outputting Streamfield content - this replicates the behavior of Django’s `{% include %}` tag, passing on the full template context by default. For full documentation, see [Template rendering with include_block](../topics/streamfield.md#streamfield-template-rendering). This feature was developed by Matt Westcott, and additionally ported to Jinja2 (see: [Jinja2 template support](../reference/jinja2.md)) by Mikalai Radchuk. ### Unicode page slugs Page URL slugs can now contain Unicode characters, when using Django 1.9 or above. This feature was developed by Behzad Nategh. ### Permission-limited explorer menu The explorer sidebar menu now limits the displayed pages to the ones the logged-in user has permission for. For example, if a user has permission over the pages MegaCorp / Departments / Finance and MegaCorp / Departments / HR, then their menu will begin at “Departments”. This reduces the amount of “drilling-down” the user has to do, and is an initial step towards supporting fully independent sites on the same Wagtail installation. This feature was developed by Matt Westcott and Robert Rollins, California Institute of Technology. ### Minor features * Image upload form in image chooser now performs client side validation so that the selected file is not lost in the submission (Jack Paine) * oEmbed URL for audioBoom was updated (Janneke Janssen) * Remember tree location in page chooser when switching between Internal / External / Email link (Matt Westcott) * `FieldRowPanel` now creates equal-width columns automatically if `col*` classnames are not specified (Chris Rogers) * Form builder now validates against multiple fields with the same name (Richard McMillan) * The ‘choices’ field on the form builder no longer has a maximum length (Johannes Spielmann) * Multiple ChooserBlocks inside a StreamField are now prefetched in bulk, for improved performance (Michael van Tellingen, Roel Bruggink, Matt Westcott) * Added new EmailBlock and IntegerBlock (Oktay Altay) * Added a new FloatBlock, DecimalBlock and a RegexBlock (Oktay Altay, Andy Babic) * Wagtail version number is now shown on the settings menu (Chris Rogers) * Added a system check to validate that fields listed in `search_fields` are defined on the model (Josh Schneier) * Added formal APIs for customizing the display of StructBlock forms within the page editor - see [Custom editing interfaces for StructBlock](../advanced_topics/customization/streamfield_blocks.md#custom-editing-interfaces-for-structblock) (Matt Westcott) * `wagtailforms.models.AbstractEmailForm` now supports multiple email recipients (Serafeim Papastefanos) * Added ability to delete users through Settings -> Users (Vincent Audebert; thanks also to Ludolf Takens and Tobias Schmidt for alternative implementations) * Page previews now pass additional HTTP headers, to simulate the page being viewed by the logged-in user and avoid clashes with middleware (Robert Rollins) * Added back buttons to page delete and unpublish confirmation screens (Matt Westcott) * Recognise Flickr embed URLs using HTTPS (Danielle Madeley) * Success message when publishing a page now correctly respects custom URLs defined on the specific page class (Chris Darko) * Required blocks inside StreamField are now indicated with asterisks (Stephen Rice) ### Bug fixes * Email templates and document uploader now support custom `STATICFILES_STORAGE` (Jonny Scholes) * Removed alignment options (deprecated in HTML and not rendered by Wagtail) from `TableBlock` context menu (Moritz Pfeiffer) * Fixed incorrect CSS path on ModelAdmin’s “choose a parent page” view * Prevent empty redirect by overnormalization * “Remove link” button in rich text editor didn’t trigger “edit” event, leading to the change to sometimes not be persisted (Matt Westcott) * `RichText` values can now be correctly evaluated as booleans (Mike Dingjan, Bertrand Bordage) * wagtailforms no longer assumes an .html extension when determining the landing page template filename (kakulukia) * Fixed styling glitch on bi-colour icon + text buttons in Chrome (Janneke Janssen) * StreamField can now be used in an InlinePanel (Gagaro) * StreamField block renderings using templates no longer undergo double escaping when using Jinja2 (Aymeric Augustin) * RichText objects no longer undergo double escaping when using Jinja2 (Aymeric Augustin, Matt Westcott) * Saving a page by pressing enter key no longer triggers a “Changes may not be saved message” (Sean Muck, Matt Westcott) * RoutablePageMixin no longer breaks in the presence of instance-only attributes such as those generated by FileFields (Fábio Macêdo Mendes) * The `--schema-only` flag on update_index no longer expects an argument (Karl Hobley) * Added file handling to support custom user add/edit forms with images/files (Eraldo Energy) * Placeholder text in modeladmin search now uses the correct template variable (Adriaan Tijsseling) * Fixed bad SQL syntax for updating URL paths on Microsoft SQL Server (Jesse Legg) * Added workaround for Django 1.10 bug [https://code.djangoproject.com/ticket/27037](https://code.djangoproject.com/ticket/27037) causing forms with file upload fields to fail validation (Matt Westcott) ## Upgrade considerations ### Form builder `FormField` models require a migration There are some changes in the `wagtailforms.models.AbstractFormField` model: * The `choices` field has been changed from a `CharField` to a `TextField`, to allow it to be of unlimited length; * The help text for the `to_address` field has been changed: it now gives more information on how to specify multiple addresses. These changes require migration. If you are using the `wagtailforms` module in your project, you will need to run `python manage.py makemigrations` and `python manage.py migrate` after upgrading, to apply changes to your form page models. ### `TagSearchable` needs removing from custom image / document model migrations The mixin class `wagtail.wagtailadmin.taggable.TagSearchable`, used internally by image and document models, has been deprecated. If you are using custom image or document models in your project, the migration(s) which created them will contain frozen references to `wagtail.wagtailadmin.taggable.TagSearchable`, which must now be removed. The line: ```python import wagtail.wagtailadmin.taggable ``` should be replaced by: ```python import wagtail.wagtailsearch.index ``` and the line: ```python bases=(models.Model, wagtail.wagtailadmin.taggable.TagSearchable), ``` should be updated to: ```python bases=(models.Model, wagtail.wagtailsearch.index.Indexed), ``` ### `render` and `render_basic` methods on StreamField blocks now accept a `context` keyword argument The `render` and `render_basic` methods on `wagtail.wagtailcore.blocks.Block` have been updated to accept an optional `context` keyword argument, a template context to use when rendering the block. If you have defined any custom StreamField blocks that override either of these methods, the method signature now needs to be updated to include this keyword argument: ```python class MyBlock(Block): def render(self, value): ... def render_basic(self, value): ... ``` should now become: ```python class MyBlock(Block): def render(self, value, context=None): ... def render_basic(self, value, context=None): ... ``` # 1.7.html.md # Wagtail 1.7 release notes *October 20, 2016* > * [What’s new](#what-s-new) > * [Upgrade considerations](#upgrade-considerations) ## What’s new ### Elasticsearch 2 support Wagtail now supports Elasticsearch 2. Note that you need to change backend in `WAGTAILSEARCH_BACKENDS`, if you wish to switch to Elasticsearch 2. This feature was developed by Karl Hobley. See: [Elasticsearch Backend](../topics/search/backends.md#wagtailsearch-backends-elasticsearch) ### New image tag options for file type and JPEG compression level The `{% image %}` tag now supports extra parameters for specifying the image file type and JPEG compression level on a per-tag basis. See [Output image format](../topics/images.md#output-image-format) and [Image quality](../topics/images.md#image-quality). This feature was developed by Karl Hobley. ### AWS CloudFront support added to cache invalidation module Wagtail’s cache invalidation module can now invalidate pages cached in AWS CloudFront when they are updated or unpublished. This feature was developed by Rob Moorman. See: [Amazon CloudFront](../reference/contrib/frontendcache.md#frontendcache-aws-cloudfront) ### Unpublishing subpages Unpublishing a page now gives the option to unpublish its subpages at the same time. This feature was developed by Jordi Joan. ### Minor features * The `|embed` filter has been converted into a templatetag `{% embed %}` (Janneke Janssen) * The `wagtailforms` module now provides a `FormSubmissionPanel` for displaying details of form submissions; see [Displaying form submission information](../reference/contrib/forms/index.md#wagtailforms-formsubmissionpanel) for documentation. (João Luiz Lorencetti) * The Wagtail version number can now be obtained as a tuple using `from wagtail import VERSION` (Tim Heap) * `send_mail` logic has been moved from `AbstractEmailForm.process_form_submission` into `AbstractEmailForm.send_mail`. Now it’s easier to override this logic (Tim Leguijt) * Added `before_create_page`, `before_edit_page`, `before_delete_page` hooks (Karl Hobley) * Updated font sizes and colors to improve legibility of admin menu and buttons (Stein Strindhaug) * Added pagination to “choose destination” view when moving pages (Nick Smith, Žan Anderle) * Added ability to annotate search results with score - see [Annotating results with score](../topics/search/searching.md#wagtailsearch-annotating-results-with-score) (Karl Hobley) * Added ability to limit access to form submissions - see [filter_form_submissions_for_user](../reference/hooks.md#filter-form-submissions-for-user) (Mikalai Radchuk) * Added the ability to configure the number of days search logs are kept for, through the [WAGTAILSEARCH_HITS_MAX_AGE](../reference/settings.md#wagtailsearch-hits-max-age) setting (Stephen Rice) * `SnippetChooserBlock` now supports passing the model name as a string (Nick Smith) * Redesigned account settings / logout area in the sidebar for better clarity (Janneke Janssen) * Pillow’s image optimization is now applied when saving JPEG images (Karl Hobley) ### Bug fixes * Migrations for wagtailcore and project template are now reversible (Benjamin Bach) * Migrations no longer depend on wagtailcore and taggit’s `__latest__` migration, logically preventing those apps from receiving new migrations (Matt Westcott) * The default image format label text (‘Full width’, ‘Left-aligned’, ‘Right-aligned’) is now localized (Mikalai Radchuk) * Text on the front-end ‘password required’ form is now marked for translation (Janneke Janssen) * Text on the page view restriction form is now marked for translation (Luiz Boaretto) * Fixed toggle behaviour of userbar on mobile (Robert Rollins) * Image rendition / document file deletion now happens on a post_delete signal, so that files are not lost if the deletion does not proceed (Janneke Janssen) * “Your recent edits” list on dashboard no longer leaves out pages that another user has subsequently edited (Michael Cordover, Kees Hink, João Luiz Lorencetti) * `InlinePanel` now accepts a `classname` parameter as per the documentation (emg36, Matt Westcott) * Disabled use of escape key to revert content of rich text fields, which could cause accidental data loss (Matt Westcott) * Setting `USE_THOUSAND_SEPARATOR = True` no longer breaks the rendering of numbers in JS code for InlinePanel (Mattias Loverot, Matt Westcott) * Images / documents pagination now preserves GET parameters (Bojan Mihelac) * Wagtail’s UserProfile model now sets a related_name of `wagtail_userprofile` to avoid naming collisions with other user profile models (Matt Westcott) * Non-text content is now preserved when adding or editing a link within rich text (Matt Westcott) * Fixed preview when `SECURE_SSL_REDIRECT = True` (Aymeric Augustin) * Prevent hang when truncating an image filename without an extension (Ricky Robinett) ## Upgrade considerations ### Project template’s initial migration should not depend on `wagtailcore.__latest__` On projects created under previous releases of Wagtail, the `home/migrations/0001_initial.py` migration created by the `wagtail start` command contains the following dependency line: ```python dependencies = [ ('wagtailcore', '__latest__'), ] ``` This may produce `InconsistentMigrationHistory` errors under Django 1.10 when upgrading Wagtail, since Django interprets this to mean that no new migrations can legally be added to wagtailcore after this migration is applied. This line should be changed to: ```python dependencies = [ ('wagtailcore', '0029_unicode_slugfield_dj19'), ] ``` ### Custom image models require a data migration for the new `filter_spec` field The data model for image renditions will be changed in Wagtail 1.8 to eliminate `Filter` as a model. Wagtail sites using a custom image model (see [Custom image models](../advanced_topics/images/custom_image_model.md#custom-image-model)) need to have a schema and data migration in place before upgrading to Wagtail 1.8. To create these migrations: * Run `manage.py makemigrations` to create the schema migration * Run `manage.py makemigrations --empty myapp` (replacing `myapp` with the name of the app containing the custom image model) to create an empty migration * Edit the created migration to contain: ```python from wagtail.wagtailimages.utils import get_fill_filter_spec_migrations ``` and, for the `operations` list: ```python forward, reverse = get_fill_filter_spec_migrations('myapp', 'CustomRendition') operations = [ migrations.RunPython(forward, reverse), ] ``` replacing `myapp` and `CustomRendition` with the app and model name for the custom rendition model. ### `embed` template filter is now a template tag The `embed` template filter, used to translate the URL of a media resource (such as a YouTube video) into a corresponding embeddable HTML fragment, has now been converted to a template tag. Any template code such as: ```html+django {% load wagtailembeds_tags %} ... {{ my_media_url|embed }} ``` should now be rewritten as: ```html+django {% load wagtailembeds_tags %} ... {% embed my_media_url %} ``` # 1.8.1.html.md # Wagtail 1.8.1 release notes *January 26, 2017* > * [What’s changed](#what-s-changed) ## What’s changed ### Bug fixes * Reduced `Rendition.focal_point_key` field length to prevent migration failure when upgrading to Wagtail 1.8 on MySQL with `utf8` character encoding (Andy Chosak, Matt Westcott) # 1.8.2.html.md # Wagtail 1.8.2 release notes *April 21, 2017* > * [What’s changed](#what-s-changed) ## What’s changed ### Bug fixes * Removed erroneous `|safe` filter from search results template in project template (Karl Hobley) * Avoid indexing unsaved field content on `save(update_fields=[...])` operations (Matt Westcott) * Prevent pages from being recursively copied into themselves (Matheus Bratfisch) # 1.8.html.md # Wagtail 1.8 (LTS) release notes *December 15, 2016* > * [What’s new](#what-s-new) > * [Upgrade considerations](#upgrade-considerations) Wagtail 1.8 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 8 months). ## What’s new ### New page privacy options ![image](_static/images/releasenotes_1_8_pageprivacy.png) Access to pages can now be restricted based on user accounts and group membership, rather than just through a shared password. This makes it possible to set up intranet-style sites via the admin, with no additional coding. This feature was developed by Shawn Makinson, Tom Miller, Luca Perico and Matt Westcott. See: [Private pages](../advanced_topics/privacy.md#private-pages) ### Restrictions on bulk-deletion of pages Previously, any user with edit permission over a page and its descendants was able to delete them all as a single action, which led to the risk of accidental deletions. To guard against this, the permission rules have been revised so that a user with basic permissions can only delete pages that have no children; to delete a whole subtree, they must individually delete each child page first. A new “bulk delete” permission type has been added which allows a user to delete pages with children, as before; superusers receive this permission implicitly, and so there is no change of behavior for them. This feature was developed by Matt Westcott. ### Elasticsearch 5 support Wagtail now supports Elasticsearch 5. See [Elasticsearch Backend](../topics/search/backends.md#wagtailsearch-backends-elasticsearch) for configuration details. This feature was developed by Karl Hobley. ### Permission-limited admin breadcrumb Breadcrumb links within the admin are now limited to the portion of the page tree that covers all pages the user has permission over. As with the changes to the explorer sidebar menu in Wagtail 1.6, this is a step towards supporting full multi-tenancy (where multiple sites on the same Wagtail installation can be fully isolated from each other through permission configuration). This feature was developed by Jeffrey Chau, Robert Rollins and Matt Westcott. ### Updated tutorial The “[Your first Wagtail site](../getting_started/tutorial.md)” tutorial has been extensively updated to cover concepts such as dynamic page listings, template context variables, and tagging. This update was contributed by Scot Hacker, with additions from Matt Westcott. ### Other features * Added support of a custom `edit_handler` for site settings. See [docs for the site settings module](../reference/contrib/settings.md#edit-handlers-settings). (Axel Haustant) * Added `get_landing_page_template` getter method to `AbstractForm` (Gagaro) * Added `Page.get_admin_display_title` method to override how the title is displayed in the admin (Henk-Jan van Hasselaar) * Added support for specifying custom HTML attributes for table rows on ModelAdmin index pages. (Andy Babic) * Added `first_common_ancestor` method to `PageQuerySet` (Tim Heap) * Page chooser now opens at the deepest ancestor page that covers all the pages of the required page type (Tim Heap) * `PageChooserBlock` now accepts a `target_model` option to specify the required page type (Tim Heap) * Modeladmin forms now respect `fields` / `exclude` options passed on custom model forms (Thejaswi Puthraya) * Added new StreamField block type `StaticBlock` for blocks that occupy a position in a stream but otherwise have no configuration; see [StaticBlock](../reference/streamfield/blocks.md#streamfield-staticblock) (Benoît Vogel) * Added new StreamField block type `BlockQuoteBlock` (Scot Hacker) * Updated Cloudflare cache module to use the v4 API (Albert O’Connor) * Added `exclude_from_explorer` attribute to the `ModelAdmin` class to allow hiding instances of a page type from Wagtail’s explorer views (Andy Babic) * Added `above_login`, `below_login`, `fields` and `login_form` customization blocks to the login page template - see [Customizing admin templates](../advanced_topics/customization/admin_templates.md) (Tim Heap) * `ChoiceBlock` now accepts a callable as the choices list (Mikalai Radchuk) * Redundant action buttons are now omitted from the root page in the explorer (Nick Smith) * Locked pages are now disabled from editing at the browser level (Edd Baldry) * Added [`wagtail.query.PageQuerySet.in_site()`](../reference/pages/queryset_reference.md#wagtail.query.PageQuerySet.in_site) method for filtering page QuerySets to pages within the specified site (Chris Rogers) * Added the ability to override the default index settings for Elasticsearch. See [Elasticsearch Backend](../topics/search/backends.md#wagtailsearch-backends-elasticsearch) (PyMan Claudio Marinozzi) * Extra options for the Elasticsearch constructor should be now defined with the new key `OPTIONS` of the `WAGTAILSEARCH_BACKENDS` setting (PyMan Claudio Marinozzi) ### Bug fixes * `AbstractForm` now respects custom `get_template` methods on the page model (Gagaro) * Use specific page model for the parent page in the explore index (Gagaro) * Remove responsive styles in embed when there is no ratio available (Gagaro) * Parent page link in page search modal no longer disappears on hover (Dan Braghis) * ModelAdmin views now consistently call `get_context_data` (Andy Babic) * Header for search results on the redirects index page now shows the correct count when the listing is paginated (Nick Smith) * `set_url_paths` management command is now compatible with Django 1.10 (Benjamin Bach) * Form builder email notifications now output multiple values correctly (Sævar Öfjörð Magnússon) * Closing ‘more’ dropdown on explorer no longer jumps to the top of the page (Ducky) * Users with only publish permission are no longer given implicit permission to delete pages (Matt Westcott) * `search_garbage_collect` management command now works when wagtailsearchpromotions is not installed (Morgan Aubert) * `wagtail.contrib.settings` context processor no longer fails when `request.site` is unavailable (Diederik van der Boor) * `TableBlock` content is now indexed for search (Morgan Aubert) * `Page.copy()` is now marked as `alters_data`, to prevent template code from triggering it (Diederik van der Boor) ## Upgrade considerations ### `unique_together` constraint on custom image rendition models needs updating If your project is using a custom image model (see [Custom image models](../advanced_topics/images/custom_image_model.md#custom-image-model)), you will need to update the `unique_together` option on the corresponding Rendition model when upgrading to Wagtail 1.8. Change the line: ```python unique_together = ( ('image', 'filter', 'focal_point_key'), ) ``` to: ```python unique_together = ( ('image', 'filter_spec', 'focal_point_key'), ) ``` You will then be able to run `manage.py makemigrations` and `manage.py migrate` as normal. Additionally, third-party code that accesses the Filter and Rendition models directly should note the following and make updates where applicable: * `Filter` will no longer be a Django model as of Wagtail 1.9, and as such, ORM operations on it (such as `save()` and `Filter.objects`) are deprecated. It should be instantiated and used as an in-memory object instead - for example, `flt, created = Filter.objects.get_or_create(spec='fill-100x100')` should become `flt = Filter(spec='fill-100x100')`. * The `filter` field of Rendition models is no longer in use; lookups should instead be performed on the `filter_spec` field, which contains a filter spec string such as `'fill-100x100'`. ### `wagtail.wagtailimages.models.get_image_model` has moved The `get_image_model` function should now be imported from `wagtail.wagtailimages` rather than `wagtail.wagtailimages.models`. See [Referring to the image model](../advanced_topics/images/custom_image_model.md#custom-image-model-referring-to-image-model). ### Non-administrators now need ‘bulk delete’ permission to delete pages with children As a precaution against accidental data loss, this release introduces a new “bulk delete” permission on pages, which can be set through the Settings -> Groups area. Non-administrator users must have this permission to delete pages that have children; a user without this permission would have to delete each child individually before deleting the parent. By default, no groups are assigned this new permission. If you wish to restore the previous behavior and don’t want to configure permissions manually through the admin interface, you can do so with a data migration. Create an empty migration using `./manage.py makemigrations myapp --empty --name assign_bulk_delete_permission` (replacing `myapp` with the name of one of your project’s apps) and edit the migration file to contain the following: ```python from __future__ import unicode_literals from django.db import migrations def add_bulk_delete_permission(apps, schema_editor): """Find all groups with add/edit page permissions, and assign them bulk_delete permission""" GroupPagePermission = apps.get_model('wagtailcore', 'GroupPagePermission') for group_id, page_id in GroupPagePermission.objects.filter( permission_type__in=['add', 'edit'] ).values_list('group', 'page').distinct(): GroupPagePermission.objects.create( group_id=group_id, page_id=page_id, permission_type='bulk_delete' ) def remove_bulk_delete_permission(apps, schema_editor): GroupPagePermission = apps.get_model('wagtailcore', 'GroupPagePermission') GroupPagePermission.objects.filter(permission_type='bulk_delete').delete() class Migration(migrations.Migration): dependencies = [ # keep the original dependencies line ] operations = [ migrations.RunPython(add_bulk_delete_permission, remove_bulk_delete_permission), ] ``` ### Cloudflare cache module now requires a `ZONEID` setting The `wagtail.contrib.wagtailfrontendcache.backends.CloudflareBackend` module has been updated to use Cloudflare’s v4 API, replacing the previous v1 implementation (which is [unsupported as of November 9th, 2016](https://www.cloudflare.com/docs/client-api/)). The new API requires users to supply a *zone identifier*, which should be passed as the `ZONEID` field of the `WAGTAILFRONTENDCACHE` setting: ```python WAGTAILFRONTENDCACHE = { 'cloudflare': { 'BACKEND': 'wagtail.contrib.wagtailfrontendcache.backends.CloudflareBackend', 'EMAIL': 'your-cloudflare-email-address@example.com', 'TOKEN': 'your cloudflare api token', 'ZONEID': 'your cloudflare domain zone id', }, } ``` For details of how to obtain the zone identifier, see [the Cloudflare API documentation](https://developers.cloudflare.com/api/). ### Extra options for the Elasticsearch constructor should be now defined with the new key `OPTIONS` of the `WAGTAILSEARCH_BACKENDS` setting For the Elasticsearch backend, all extra keys defined in `WAGTAILSEARCH_BACKENDS` are passed directly to the Elasticsearch constructor. All these keys now should be moved inside the new `OPTIONS` dictionary. The old behavior is still supported but deprecated. For example, the following configuration changes the connection class that the Elasticsearch [connector](https://elasticsearch-py.readthedocs.io/en/5.0.0/api.html#elasticsearch) uses: ```python from elasticsearch import RequestsHttpConnection WAGTAILSEARCH_BACKENDS = { 'default': { 'BACKEND': 'wagtail.wagtailsearch.backends.elasticsearch', 'connection_class': RequestsHttpConnection, } } ``` As `connection_class` needs to be passed through to the Elasticsearch [connector](https://elasticsearch-py.readthedocs.io/en/5.0.0/api.html#elasticsearch), it should be moved to the new `OPTIONS` dictionary: ```python from elasticsearch import RequestsHttpConnection WAGTAILSEARCH_BACKENDS = { 'default': { 'BACKEND': 'wagtail.wagtailsearch.backends.elasticsearch', 'OPTIONS': { 'connection_class': RequestsHttpConnection, } } } ``` # 1.9.1.html.md # Wagtail 1.9.1 release notes *April 21, 2017* > * [What’s changed](#what-s-changed) ## What’s changed ### Bug fixes * Removed erroneous `|safe` filter from search results template in project template (Karl Hobley) * Prevent pages from being recursively copied into themselves (Matheus Bratfisch) # 1.9.html.md # Wagtail 1.9 release notes *February 16, 2017* > * [What’s new](#what-s-new) > * [Upgrade considerations](#upgrade-considerations) ## What’s new ### Revision comparisons ![image](_static/images/releasenotes_1_9_revisioncomparison.png) Wagtail now provides the ability to view differences between revisions of a page, from the revisions listing page and when reviewing a page in moderation. This feature was developed by Karl Hobley, Janneke Janssen and Matt Westcott. Thank you to Blackstone Chambers for sponsoring this feature. ### Many-to-many relations on page models ![image](_static/images/releasenotes_1_9_m2m.png) Wagtail now supports a new field type `ParentalManyToManyField` that can be used to set up many-to-many relations on pages. For details, see the [Authors](../getting_started/tutorial.md#tutorial-categories) section of the tutorial. This feature was developed by Thejaswi Puthraya and Matt Westcott. ### Bulk-deletion of form submissions Form builder form submissions can now be deleted in bulk from the form submissions index page. This feature was sponsored by St John’s College, Oxford and developed by Karl Hobley. ### Accessing parent context from StreamField block `get_context` methods The `get_context` method on StreamField blocks now receives a `parent_context` keyword argument, consisting of the dict of variables passed in from the calling template. For example, this makes it possible to perform pagination logic within `get_context`, retrieving the current page number from `parent_context['request'].GET`. See [get_context on StreamField blocks](../topics/streamfield.md#streamfield-get-context). This feature was developed by Mikael Svensson and Peter Baumgartner. ### Welcome message customization for multi-tenanted installations The welcome message on the admin dashboard has been updated to be more suitable for multi-tenanted installations. Users whose page permissions lie within a single site will now see that site name in the welcome message, rather than the installation-wide `WAGTAIL_SITE_NAME`. As before, this message can be customized, and additional template variables have been provided for this purpose - see [Custom branding](../advanced_topics/customization/admin_templates.md#custom-branding). This feature was developed by Jeffrey Chau. ### Other features * Changed text of “Draft” and “Live” buttons to “View draft” and “View live” (Dan Braghis) * Added `get_api_representation` method to streamfield blocks allowing the JSON representation in the API to be customized (Marco Fucci) * Added [before_copy_page](../reference/hooks.md#before-copy-page) and [after_copy_page](../reference/hooks.md#after-copy-page) hooks (Matheus Bratfisch) * View live / draft links in the admin now consistently open in a new window (Marco Fucci) * `ChoiceBlock` now omits the blank option if the block is required and has a default value (Andreas Nüßlein) * The `add_subpage` view now maintains a `next` URL parameter to specify where to redirect to after completing page creation (Robert Rollins) * The `wagtailforms` module now allows to define custom form submission model, add custom data to CSV export and some other customizations. See [Form builder customization](../reference/contrib/forms/customization.md) (Mikalai Radchuk) * The Webpack configuration is now in a subfolder to declutter the project root, and uses environment-specific configurations for smaller bundles in production and easier debugging in development (Janneke Janssen, Thibaud Colas) * Added page titles to title text on action buttons in the explorer, for improved accessibility (Matt Westcott) ### Bug fixes * Help text for StreamField is now visible and does not cover block controls (Stein Strindhaug) * “X minutes ago” timestamps are now marked for translation (Janneke Janssen, Matt Westcott) * Avoid indexing unsaved field content on save(update_fields=[…]) operations (Matt Westcott) * Corrected ordering of arguments passed to ModelAdmin `get_extra_class_names_for_field_col` / `get_extra_attrs_for_field_col` methods (Andy Babic) * `pageurl` / `slugurl` tags now function when request.site is not available (Tobias McNulty, Matt Westcott) ## Upgrade considerations ### `django-modelcluster` and `django-taggit` dependencies updated Wagtail now requires version 3.0 or later of `django-modelcluster` and version 0.20 or later of `django-taggit`; earlier versions are unsupported. In normal circumstances these packages will be upgraded automatically when upgrading Wagtail; however, if your Wagtail project has a requirements file that explicitly specifies an older version, this will need to be updated. ### `get_context` methods on StreamField blocks need updating Previously, `get_context` methods on StreamField blocks returned a dict of variables which would be merged into the calling template’s context before rendering the block template. `get_context` methods now receive a `parent_context` dict, and are responsible for returning the final context dictionary with any new variables merged into it. The old calling convention is now deprecated, and will be phased out in Wagtail 1.11. In most cases, the method will be calling `get_context` on the superclass, and can be updated by passing the new `parent_context` keyword argument to it: ```python class MyBlock(Block): def get_context(self, value): context = super(MyBlock, self).get_context(value) ... return context ``` becomes: ```python class MyBlock(Block): def get_context(self, value, parent_context=None): context = super(MyBlock, self).get_context(value, parent_context=parent_context) ... return context ``` Note that `get_context` methods on page models are unaffected by this change. # 2.0.1.html.md # Wagtail 2.0.1 release notes *April 4, 2018* > * [What’s new](#what-s-new) ## What’s new * Added error notification when running the `wagtail` command on Python <3.4 (Matt Westcott) * Added error handling to the Draftail editor (Thibaud Colas) ### Bug fixes * Draftail now supports features specified via the `WAGTAILADMIN_RICH_TEXT_EDITORS` setting (Todd Dembrey) * Password reset form no longer indicates whether the email is recognized, as per standard Django behavior (Bertrand Bordage) * `UserAttributeSimilarityValidator` is now correctly enforced on user creation / editing forms (Tim Heap) * Editing setting object with no site configured no longer crashes (Harm Zeinstra) * Creating a new object with inlines while mandatory fields are empty no longer crashes (Bertrand Bordage) # 2.0.2.html.md # Wagtail 2.0.2 release notes *August 13, 2018* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes * Restored ability to use non-model fields with FieldPanel (Matt Westcott, LB (Ben Johnston)) * Fix usage URL on the document edit page (Jérôme Lebleu) * Pin Beautiful Soup to 4.6.0 due to further regressions in formatting empty elements (Matt Westcott) # 2.0.html.md # Wagtail 2.0 release notes *February 28, 2018* > * [What’s new](#what-s-new) > * [Upgrade considerations](#upgrade-considerations) ## What’s new ### Added Django 2.0 support Wagtail is now compatible with Django 2.0. Compatibility fixes were contributed by Matt Westcott, Karl Hobley, LB (Ben Johnston) and Mads Jensen. ### New rich text editor Wagtail’s rich text editor has now been replaced with [Draftail](https://github.com/springload/draftail), a new editor based on [Draft.js](https://draftjs.org/), fixing numerous bugs and providing an improved editing experience, better support for current browsers, and more consistent HTML output. This feature was developed by Thibaud Colas, Loïc Teixeira and Matt Westcott. ### Reorganized modules The modules that make up Wagtail have been renamed and reorganized, to avoid the repetition in names like `wagtail.wagtailcore.models` (originally an artifact of app naming limitations in Django 1.6) and to improve consistency. While this will require some up-front work to upgrade existing Wagtail sites, we believe that this will be a long-term improvement to the developer experience, improving readability of code and reducing errors. This change was implemented by Karl Hobley and Matt Westcott. ### Scheduled page revisions The behavior of scheduled publishing has been revised so that pages are no longer unpublished at the point of setting a future go-live date, making it possible to schedule updates to an existing published page. This feature was developed by Patrick Woods. ### Other features * Moved Wagtail API v1 implementation (`wagtail.contrib.api`) to an [external app](https://github.com/wagtail/wagtailapi_legacy) (Karl Hobley) * The page chooser now searches all fields of a page, instead of just the title (Bertrand Bordage) * Implement ordering by date in form submission view (LB (Ben Johnston)) * Elasticsearch scroll API is now used when fetching more than 100 search results (Karl Hobley) * Added hidden field to the form builder (Ross Crawford-d’Heureuse) * Usage count now shows on delete confirmation page when WAGTAIL_USAGE_COUNT_ENABLED is active (Kees Hink) * Added usage count to snippets (Kees Hink) * Moved usage count to the sidebar on the edit page (Kees Hink) * Explorer menu now reflects customizations to the page listing made via the construct_explorer_page_queryset hook and ModelAdmin.exclude_from_explorer property (Tim Heap) * “Choose another image” button changed to “Change image” to avoid ambiguity (Edd Baldry) * Added hooks `before_create_user`, `after_create_user`, `before_delete_user`, `after_delete_user`, `before_edit_user`, `after_edit_user` (Jon Carmack) * Added `exclude_fields_in_copy` property to Page to define fields that should not be included on page copy (LB (Ben Johnston)) * Improved error message on incorrect `{% image %}` tag syntax (LB (Ben Johnston)) * Optimised preview data storage (Bertrand Bordage) * Added `render_landing_page` method to `AbstractForm` to be easily overridden and pass `form_submission` to landing page context (Stein Strindhaug) * Added `heading` kwarg to `InlinePanel` to allow heading to be set independently of button label (Adrian Turjak) * The value type returned from a `StructBlock` can now be customized. See [Additional methods and properties on StructBlock values](../advanced_topics/customization/streamfield_blocks.md#custom-value-class-for-structblock) (LB (Ben Johnston)) * Added `bgcolor` image operation (Karl Hobley) * Added `WAGTAILADMIN_USER_LOGIN_FORM` setting for overriding the admin login form (Mike Dingjan) * Snippets now support custom primary keys (Sævar Öfjörð Magnússon) * Upgraded jQuery to version 3.2.1 (Janneke Janssen) * Update autoprefixer configuration to better match browser support targets (Janneke Janssen) * Update React and related dependencies to latest versions (Janneke Janssen, Hugo van den Berg) * Remove Hallo editor `.richtext` CSS class in favor of more explicit extension points (Thibaud Colas) * Updated documentation styling (LB (Ben Johnston)) * Rich text fields now take feature lists into account when whitelisting HTML elements (Matt Westcott) * FormPage lists and Form submission lists in admin now use class based views for easy overriding (Johan Arensman) * Form submission csv exports now have the export date in the filename and can be customized (Johan Arensman) * FormBuilder class now uses bound methods for field generation, adding custom fields is now easier and documented (LB (Ben Johnston)) * Added `WAGTAILADMIN_NOTIFICATION_INCLUDE_SUPERUSERS` setting to determine whether superusers are included in moderation email notifications (Bruno Alla) * Added a basic Dockerfile to the project template (Tom Dyson) * StreamField blocks now allow custom `get_template` methods for overriding templates in instances (Christopher Bledsoe) * Simplified edit handler API (Florent Osmont, Bertrand Bordage) * Made ‘add/change/delete collection’ permissions configurable from the group edit page (Matt Westcott) * Expose React-related dependencies as global variables for extension in the admin interface (Thibaud Colas) * Added helper functions for constructing form data for use with `assertCanCreate`. See [Form data helpers](../advanced_topics/testing.md#form-data-test-helpers) (Tim Heap, Matt Westcott) ### Bug fixes * Do not remove stopwords when generating slugs from non-ASCII titles, to avoid issues with incorrect word boundaries (Sævar Öfjörð Magnússon) * The PostgreSQL search backend now preserves ordering of the `QuerySet` when searching with `order_by_relevance=False` (Bertrand Bordage) * Using `modeladmin_register` as a decorator no longer replaces the decorated class with `None` (Tim Heap) * Fixed crash in XML sitemap generator when all pages on the site are private (Stein Strindhaug) * The `{% routablepageurl %}` template tag no longer generates invalid URLs when the `WAGTAIL_APPEND_SLASH` setting was set to `False` (Venelin Stoykov) * The “View live” button is no longer shown if the page doesn’t have a routable URL (Tim Heap) * API listing views no longer fail when no site records are defined (Karl Hobley) * Fixed rendering of border on dropdown arrow buttons on Chrome (Bertrand Bordage) * Fixed incorrect z-index on userbar causing it to appear behind page content (Stein Strindhaug) * Form submissions pagination no longer looses date filter when changing page (Bertrand Bordage) * PostgreSQL search backend now removes duplicate page instances from the database (Bertrand Bordage) * `FormSubmissionsPanel` now recognizes custom form submission classes (LB (Ben Johnston)) * Prevent the footer and revisions link from unnecessarily collapsing on mobile (Jack Paine) * Empty searches were activated when paginating through images and documents (LB (Ben Johnston)) * Summary numbers of pages, images and documents were not responsive when greater than 4 digits (Michael Palmer) * Project template now has password validators enabled by default (Matt Westcott) * Alignment options correctly removed from `TableBlock` context menu (LB (Ben Johnston)) * Fix support of `ATOMIC_REBUILD` for projects with Elasticsearch client `>=1.7.0` (Mikalai Radchuk) * Fixed error on Elasticsearch backend when passing a QuerySet as an `__in` filter (Karl Hobley, Matt Westcott) * `__isnull` filters no longer fail on Elasticsearch 5 (Karl Hobley) * Prevented intermittent failures on Postgres search backend when a field is defined as both a `SearchField` and a `FilterField` (Matt Westcott) * Alt text of images in rich text is no longer truncated on double-quote characters (Matt Westcott) * Ampersands in embed URLs within rich text are no longer double-escaped (Matt Westcott) * Using RGBA images no longer crashes with Pillow >= 4.2.0 (Karl Hobley) * Copying a page with PostgreSQL search enabled no longer crashes (Bertrand Bordage) * Style of the page unlock button was broken (Bertrand Bordage) * Admin search no longer floods browser history (Bertrand Bordage) * Version comparison now handles custom primary keys on inline models correctly (LB (Ben Johnston)) * Fixed error when inserting chooser panels into FieldRowPanel (Florent Osmont, Bertrand Bordage) * Reinstated missing error reporting on image upload (Matt Westcott) * Only load Hallo CSS if Hallo is in use (Thibaud Colas) * Prevent style leak of Wagtail panel icons in widgets using `h2` elements (Thibaud Colas) ## Upgrade considerations ### Removed support for Python 2.7, Django 1.8 and Django 1.10 Python 2.7, Django 1.8 and Django 1.10 are no longer supported in this release. You are advised to upgrade your project to Python 3 and Django 1.11 before upgrading to Wagtail 2.0. ### Added support for Django 2.0 Before upgrading to Django 2.0, you are advised to review the [release notes](https://docs.djangoproject.com/en/stable/releases/2.0/), especially the [backwards incompatible changes](https://docs.djangoproject.com/en/stable/releases/2.0/#backwards-incompatible-changes-in-2-0) and [removed features](https://docs.djangoproject.com/en/stable/releases/2.0/#features-removed-in-2-0). ### Wagtail module path updates Many of the module paths within Wagtail have been reorganized to reduce duplication - for example, `wagtail.wagtailcore.models` is now `wagtail.core.models`. As a result, `import` lines and other references to Wagtail modules will need to be updated when you upgrade to Wagtail 2.0. A new command has been added to assist with this - from the root of your project’s code base: ```console $ 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 ``` Or, to run from a different location: ```console $ wagtail updatemodulepaths /path/to/project --list $ wagtail updatemodulepaths /path/to/project --diff $ wagtail updatemodulepaths /path/to/project ``` For the full list of command line options, enter `wagtail help updatemodulepaths`. You are advised to take a backup of your project codebase before running this command. The command will perform a search-and-replace over all \*.py files for the affected module paths; while this should catch the vast majority of module references, it will not be able to fix instances that do not use the dotted path directly, such as `from wagtail import wagtailcore`. The full list of modules to be renamed is as follows: | Old name | New name | Notes | |-----------------------------------------|-----------------------------------|-----------------------------------| | wagtail.wagtailcore | wagtail.core | | | wagtail.wagtailadmin | wagtail.admin | | | wagtail.wagtaildocs | wagtail.documents | ‘documents’ no longer abbreviated | | wagtail.wagtailembeds | wagtail.embeds | | | wagtail.wagtailimages | wagtail.images | | | wagtail.wagtailsearch | wagtail.search | | | wagtail.wagtailsites | wagtail.sites | | | wagtail.wagtailsnippets | wagtail.snippets | | | wagtail.wagtailusers | wagtail.users | | | wagtail.wagtailforms | wagtail.contrib.forms | Moved into ‘contrib’ | | wagtail.wagtailredirects | wagtail.contrib.redirects | Moved into ‘contrib’ | | wagtail.contrib.wagtailapi | *removed* | API v1, removed in this release | | wagtail.contrib.wagtailfrontendcache | wagtail.contrib.frontend_cache | Underscore added | | wagtail.contrib.wagtailroutablepage | wagtail.contrib.routable_page | Underscore added | | wagtail.contrib.wagtailsearchpromotions | wagtail.contrib.search_promotions | Underscore added | | wagtail.contrib.wagtailsitemaps | wagtail.contrib.sitemaps | | | wagtail.contrib.wagtailstyleguide | wagtail.contrib.styleguide | | Places these should be updated include: * `import` lines * Paths specified in settings, such as `INSTALLED_APPS`, `MIDDLEWARE` and `WAGTAILSEARCH_BACKENDS` * Fields and blocks referenced within migrations, such as `wagtail.wagtailcore.fields.StreamField` and `wagtail.wagtailcore.blocks.RichTextBlock` However, note that this only applies to dotted module paths beginning with `wagtail.`. App names that are *not* part of a dotted module path should be left unchanged - in this case, the `wagtail` prefix is still required to avoid clashing with other apps that might exist in the project with names such as `admin` or `images`. The following should be left unchanged: * Foreign keys specifying a model as `'app_name.ModelName'`, e.g. `models.ForeignKey('wagtailimages.Image',...)` * App labels used in database table names, content types or permissions * Paths to templates and static files, e.g. when [overriding admin templates with custom branding](../advanced_topics/customization/admin_templates.md#custom-branding) * Template tag library names, e.g. `{% load wagtailcore_tags %}` ### Hallo.js customizations are unavailable on the Draftail rich text editor The Draftail rich text editor has a substantially different API from Hallo.js, including the use of a non-HTML format for its internal data representation; as a result, functionality added through Hallo.js plugins will be unavailable. If your project is dependent on Hallo.js-specific behavior, you can revert to the original Hallo-based editor by adding the following to your settings: ```python WAGTAILADMIN_RICH_TEXT_EDITORS = { 'default': { 'WIDGET': 'wagtail.admin.rich_text.HalloRichTextArea' } } ``` ### Data format for rich text fields in `assertCanCreate` tests has been updated The `assertCanCreate` test method (see [Testing your Wagtail site](../advanced_topics/testing.md)) requires data to be passed in the same format that the page edit form would submit. The Draftail rich text editor posts this data in a non-HTML format, and so any existing `assertCanCreate` tests involving rich text fields will fail when Draftail is in use: ```python self.assertCanCreate(root_page, ContentPage, { 'title': 'About us', 'body': '

Lorem ipsum dolor sit amet

', # will not work }) ``` Wagtail now provides a set of helper functions for constructing form data: see [Form data helpers](../advanced_topics/testing.md#form-data-test-helpers). The above assertion can now be rewritten as: ```python from wagtail.tests.utils.form_data import rich_text self.assertCanCreate(root_page, ContentPage, { 'title': 'About us', 'body': rich_text('

Lorem ipsum dolor sit amet

'), }) ``` ### Removed support for Elasticsearch 1.x Elasticsearch 1.x is no longer supported in this release. Please upgrade to a 2.x or 5.x release of Elasticsearch before upgrading to Wagtail 2.0. ### Removed version 1 of the Wagtail API Version 1 of the Wagtail API (`wagtail.contrib.wagtailapi`) has been removed from Wagtail. If you’re using version 1, you will need to migrate to version 2. Please see [Wagtail API v2 configuration guide](../advanced_topics/api/v2/configuration.md) and [Wagtail API v2 usage guide](../advanced_topics/api/v2/usage.md). If migrating to version 2 is not an option right now (if you have API clients that you don’t have direct control over, such as a mobile app), you can find the implementation of the version 1 API in the new [wagtailapi_legacy](https://github.com/wagtail/wagtailapi_legacy) repository. This repository has been created to provide a place for the community to collaborate on supporting legacy versions of the API until everyone has migrated to an officially supported version. ### `construct_whitelister_element_rules` hook is deprecated The `construct_whitelister_element_rules` hook, used to specify additional HTML elements to be permitted in rich text, is deprecated. The recommended way of whitelisting elements is now to use rich text features. For example, a whitelist rule that was previously defined as: ```python from wagtail.core import hooks from wagtail.core.whitelist import allow_without_attributes @hooks.register('construct_whitelister_element_rules') def whitelist_blockquote(): return { 'blockquote': allow_without_attributes, } ``` can be rewritten as: ```python from wagtail.admin.rich_text.converters.editor_html import WhitelistRule from wagtail.core import hooks from wagtail.core.whitelist import allow_without_attributes @hooks.register('register_rich_text_features') def blockquote_feature(features): # register a feature 'blockquote' which whitelists the
element features.register_converter_rule('editorhtml', 'blockquote', [ WhitelistRule('blockquote', allow_without_attributes), ]) # add 'blockquote' to the default feature set features.default_features.append('blockquote') ``` Please note that the new Draftail rich text editor uses a different mechanism to process rich text content, and does not apply whitelist rules; they only take effect when the Hallo.js editor is in use. ### `wagtail.images.views.serve.generate_signature` now returns a string The `generate_signature` function in `wagtail.images.views.serve`, used to build URLs for the [dynamic image serve view](../advanced_topics/images/image_serve_view.md#using-images-outside-wagtail), now returns a string rather than a byte string. This ensures that any existing user code that builds up the final image URL with `reverse` will continue to work on Django 2.0 (which no longer allows byte strings to be passed to `reverse`). Any code that expects a byte string as the return value of `generate_string` - for example, calling `decode()` on the result - will need to be updated. (Apps that need to preserve compatibility with earlier versions of Wagtail can call `django.utils.encoding.force_text` instead of `decode`.) ### Deprecated search view Wagtail has always included a bundled view for frontend search. However, this view isn’t easy to customize so defining this view per project is usually preferred. If you have used this bundled view (check for an import from `wagtail.wagtailsearch.urls` in your project’s `urls.py`), you will need to replace this with your own implementation. See the search view in Wagtail demo for a guide: [https://github.com/wagtail/wagtaildemo/blob/master/demo/views.py](https://github.com/wagtail/wagtaildemo/blob/master/demo/views.py) ### New Hallo editor extension points With the introduction of a new editor, we want to make sure existing editor plugins meant for Hallo only target Hallo editors for extension. * The existing `.richtext` CSS class is no longer applied to the Hallo editor’s DOM element. * In JavaScript, use the `[data-hallo-editor]` attribute selector to target the editor, eg. `var $editor = $('[data-hallo-editor]');`. * In CSS, use the `.halloeditor` class selector. For example, ```diff /* JS */ - var widget = $(elem).parent('.richtext').data('IKS-hallo'); + var widget = $(elem).parent('[data-hallo-editor]').data('IKS-hallo'); [...] /* Styles */ - .richtext { + .halloeditor { font-family: monospace; } ``` # 2.1.1.html.md # Wagtail 2.1.1 release notes *July 4, 2018* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes * Fix `Site.get_site_root_paths()` preferring other sites over the default when some sites share the same root_page (Andy Babic) * Rich text image chooser no longer skips format selection after a validation error (Matt Westcott) * Null characters in URLs no longer crash the redirect middleware on PostgreSQL (Matt Westcott) # 2.1.2.html.md # Wagtail 2.1.2 release notes *August 6, 2018* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes * Bundle the l18n package to avoid installation issues on systems with a non-Unicode locale (Matt Westcott) * Mark Beautiful Soup 4.6.1 as incompatible due to bug in formatting empty elements (Matt Westcott) # 2.1.3.html.md # Wagtail 2.1.3 release notes *August 13, 2018* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes * Pin Beautiful Soup to 4.6.0 due to further regressions in formatting empty elements (Matt Westcott) # 2.1.html.md # Wagtail 2.1 release notes *May 22, 2018* > * [What’s new](#what-s-new) > * [Upgrade considerations](#upgrade-considerations) ## What’s new ### New `HelpPanel` A new panel type `HelpPanel` allows you to easily add HTML within an edit form. This new feature was developed by Kevin Chung. ### Profile picture upload Users can now upload profile pictures directly through the Account Settings menu, rather than using Gravatar. Gravatar is still used as a fallback if no profile picture has been uploaded directly; a new setting [WAGTAIL_GRAVATAR_PROVIDER_URL](../reference/settings.md#wagtail-gravatar-provider-url) has been added to specify an alternative provider, or disable the use of external avatars completely. This feature was developed by Daniel Chimeno, Pierre Geier and Matt Westcott. ### API lookup by page path The API now includes an endpoint for finding pages by path; see [Finding pages by HTML path](../advanced_topics/api/v2/usage.md#apiv2-finding-pages-by-path). This feature was developed by Karl Hobley. ### User time zone setting Users can now set their current time zone through the Account Settings menu, which will then be reflected in date / time fields throughout the admin (such as go-live / expiry dates). The list of available time zones can be configured via the [WAGTAIL_USER_TIME_ZONES](../reference/settings.md#wagtail-user-time-zones) setting. This feature was developed by David Moore. ### Elasticsearch 6 support Wagtail now supports Elasticsearch 6. See [Elasticsearch Backend](../topics/search/backends.md#wagtailsearch-backends-elasticsearch) for configuration details. This feature was developed by Karl Hobley. ### Other features * Persist tab hash in URL to allow direct navigation to tabs in the admin interface (Ben Weatherman) * Animate the chevron icon when opening sub-menus in the admin (Carlo Ascani) * Look through the target link and target page slug (in addition to the old slug) when searching for redirects in the admin (Michael Harrison) * Remove support for IE6 to IE9 from project template (Samir Shah) * Remove outdated X-UA-Compatible meta from admin template (Thibaud Colas) * Add JavaScript source maps in production build for packaged Wagtail (Thibaud Colas) * Removed `assert` statements from Wagtail API (Kim Chee Leong) * Update jquery-datetimepicker dependency to make Wagtail more CSP-friendly (unsafe-eval) (Pomax) * Added error notification when running the `wagtail` command on Python <3.4 (Matt Westcott) * `update_index` management command now accepts a `--chunk_size` option to determine the number of items to load at once (Dave Bell) * Added hook register_account_menu_item to add new account preference items (Michael van Tellingen) * Added change email functionality from the account settings (Alejandro Garza, Alexs Mathilda) * Add request parameter to edit handlers (Rajeev J Sebastian) * ImageChooser now sets a default title based on filename (Coen van der Kamp) * Added error handling to the Draftail editor (Thibaud Colas) * Add new wagtail_icon template tag to facilitate making admin icons accessible (Sander Tuit) * Set ALLOWED_HOSTS in the project template to allow any host in development (Tom Dyson) * Expose reusable client-side code to build Draftail extensions (Thibaud Colas) * Added `WAGTAILFRONTENDCACHE_LANGUAGES` setting to specify the languages whose URLs are to be purged when using `i18n_patterns` (PyMan Claudio Marinozzi) * Added `extra_footer_actions` template blocks for customizing the add/edit page views (Arthur Holzner) ### Bug fixes * Status button on ‘edit page’ now links to the correct URL when live and draft slug differ (LB (Ben Johnston)) * Image title text in the gallery and in the chooser now wraps for long filenames (LB (Ben Johnston), Luiz Boaretto) * Move image editor action buttons to the bottom of the form on mobile (Julian Gallo) * StreamField icons are now correctly sorted into groups on the ‘append’ menu (Tim Heap) * Draftail now supports features specified via the `WAGTAILADMIN_RICH_TEXT_EDITORS` setting (Todd Dembrey) * Password reset form no longer indicates whether the email is recognized, as per standard Django behavior (Bertrand Bordage) * `UserAttributeSimilarityValidator` is now correctly enforced on user creation / editing forms (Tim Heap) * Focal area removal not working in IE11 and MS Edge (Thibaud Colas) * Rewrite password change feedback message to be more user-friendly (Casper Timmers) * Correct dropdown arrow styling in Firefox, IE11 (Janneke Janssen, Alexs Mathilda) * Password reset no indicates specific validation errors on certain password restrictions (Lucas Moeskops) * Confirmation page on page deletion now respects custom `get_admin_display_title` methods (Kim Chee Leong) * Adding external link with selected text now includes text in link chooser (Tony Yates, Thibaud Colas, Alexs Mathilda) * Editing setting object with no site configured no longer crashes (Harm Zeinstra) * Creating a new object with inlines while mandatory fields are empty no longer crashes (Bertrand Bordage) * Localization of image and apps verbose names * Draftail editor no longer crashes after deleting image/embed using DEL key (Thibaud Colas) * Breadcrumb navigation now respects custom `get_admin_display_title` methods (Arthur Holzner, Wietze Helmantel, Matt Westcott) * Inconsistent order of heading features when adding h1, h5, or h6 as default feature for Hallo RichText editor (Loic Teixeira) * Add invalid password reset link error message (Coen van der Kamp) * Bypass select/prefetch related optimisation on `update_index` for `ParentalManyToManyField` to fix crash (Tim Kamanin) * ‘Add user’ is now rendered as a button due to the use of quotes within translations (Benoît Vogel) * Menu icon no longer overlaps with title in Modeladmin on mobile (Coen van der Kamp) * Background color overflow within the Wagtail documentation (Sergey Fedoseev) * Page count on homepage summary panel now takes account of user permissions (Andy Chosak) * Explorer view now prevents navigating outside of the common ancestor of the user’s permissions (Andy Chosak) * Generate URL for the current site when multiple sites share the same root page (Codie Roelf) * Restored ability to use non-model fields with FieldPanel (Matt Westcott, LB (Ben Johnston)) * Stop revision comparison view from crashing when non-model FieldPanels are in use (LB (Ben Johnston)) * Ordering in the page explorer now respects custom `get_admin_display_title` methods when sorting <100 pages (Matt Westcott) * Use index-specific Elasticsearch endpoints for bulk insertion, for compatibility with providers that lock down the root endpoint (Karl Hobley) * Fix usage URL on the document edit page (Jérôme Lebleu) ## Upgrade considerations ### Image format `image_to_html` method has been updated The internal API for rich text image format objects (see [Image Formats in the Rich Text Editor](../advanced_topics/customization/page_editing_interface.md#rich-text-image-formats)) has been updated; the `Format.image_to_html` method now receives the `extra_attributes` keyword argument as a dictionary of attributes, rather than a string. If you have defined any custom format objects that override this method, these will need to be updated. # 2.10.1.html.md # Wagtail 2.10.1 release notes *August 26, 2020* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes * Prevent `create_log_entries_from_revisions` command from failing when page model classes are missing (Dan Braghis) * Prevent page audit log views from failing for user models without a `username` field (Vyacheslav Matyukhin) * Fix icon alignment on menu items (Coen van der Kamp) * Page editor header bar now correctly shows ‘Published’ or ‘Draft’ status when no revisions exist (Matt Westcott) * Prevent page editor from failing when `USE_TZ` is false (Matt Westcott) * Ensure whitespace between block-level elements is preserved when stripping tags from rich text for search indexing (Matt Westcott) # 2.10.2.html.md # Wagtail 2.10.2 release notes *September 25, 2020* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes * Avoid use of `icon` class name on userbar icon to prevent clashes with front-end styles (Karran Besen) * Prevent focused button labels from displaying as white on white (Karran Bessen) * Avoid showing preview button on moderation dashboard for page types with preview disabled (Dino Perovic) * Prevent oversized buttons in moderation dashboard panel (Dan Braghis) * `create_log_entries_from_revisions` now handles revisions that cannot be restored due to foreign key constraints (Matt Westcott) # 2.10.html.md # Wagtail 2.10 release notes *August 11, 2020* > * [What’s new](#what-s-new) > * [Upgrade considerations](#upgrade-considerations) ## What’s new ### Moderation workflow This release introduces a configurable moderation workflow system to replace the single-step “submit for moderation” feature. Workflows can be set up on specific subsections of the page tree and consist of any number of tasks to be completed by designated user groups. To support this, numerous UI improvements have been made to Wagtail’s page editor, including a new log viewer to track page history. For further details, see our How-to: [Configure workflows for moderation](https://guide.wagtail.org/en-latest/how-to-guides/configure-workflows-for-moderation/) and [Adding new Task types](../extending/custom_tasks.md). This feature was developed by Jacob Topp-Mugglestone, Karl Hobley, Matt Westcott and Dan Braghis, and sponsored by [The Motley Fool](https://www.fool.com/). ### Django 3.1 support This release adds support for Django 3.1. Compatibility fixes were contributed by Matt Westcott and Karl Hobley. ### Search query expressions Search queries can now be constructed as structured expressions in the manner of the Django ORM’s `Q()` values, allowing for complex queries that combine individual terms, phrases and boosting. A helper function `parse_query_string` is provided to convert “natural” queries containing quoted phrases into these expressions. For complete documentation, see [Complex search queries](../topics/search/searching.md#wagtailsearch-complex-queries). This feature was developed by Karl Hobley and sponsored by [The Motley Fool](https://www.fool.com/). ### Redirect importing Redirects can now be imported from an uploaded CSV, TSV, XLS or XLSX file. This feature was developed by Martin Sandström. ### Accessibility and usability This release contains a number of improvements to the accessibility and general usability of the Wagtail admin, fixing long-standing issues. Some of the changes come from our January 2020 sprint in Bristol, and some from our brand new [accessibility team](https://github.com/wagtail/wagtail/wiki/Accessibility-team): * Remove sticky footer on small devices, so that content is not blocked and more easily editable (Saeed Tahmasebi) * Add SVG icons to resolve accessibility and customization issues and start using them in a subset of Wagtail’s admin (Coen van der Kamp, Scott Cranfill, Thibaud Colas, Dan Braghis) * Switch userbar and header H1s to use SVG icons (Coen van der Kamp) * Add skip link for keyboard users to bypass Wagtail navigation in the admin (Martin Coote) * Add missing dropdown icons to image upload, document upload, and site settings screens (Andreas Bernacca) * Prevent snippets’ bulk delete button from being present for screen reader users when it’s absent for sighted users (LB (Ben Johnston)) ### Other features * Added `webpquality` and `format-webp-lossless` image filters and `WAGTAILIMAGES_WEBP_QUALITY` setting. See [Output image format](../topics/images.md#output-image-format) and [Image quality](../topics/images.md#image-quality) (Nikolay Lukyanov) * Reorganised Dockerfile in project template to follow best practices (Tomasz Knapik, Jannik Wempe) * Added filtering to locked pages report (Karl Hobley) * Adds ability to view a group’s users via standalone admin URL and a link to this on the group edit view (Karran Besen) * Redirect to previous url when deleting/copying/unpublish a page and modify this url via the relevant hooks (Ascani Carlo) * Added `next_url` keyword argument on `register_page_listing_buttons` and `register_page_listing_more_buttons` hooks (Ascani Carlo, Matt Westcott, LB (Ben Johnston)) * `AbstractEmailForm` will use `SHORT_DATETIME_FORMAT` and `SHORT_DATE_FORMAT` Django settings to format date/time values in email (Haydn Greatnews) * `AbstractEmailForm` now has a separate method (`render_email`) to build up email content on submission emails. See [Custom render_email method](../reference/contrib/forms/customization.md#form-builder-render-email). (Haydn Greatnews) * Add `pre_page_move` and `post_page_move` signals. (Andy Babic) * Add ability to sort search promotions on listing page (Chris Ranjana, LB (Ben Johnston)) * Upgrade internal JS tooling; Node v10, Gulp v4 & Jest v23 (Jim Jazwiecki, Kim LaRocca, Thibaud Colas) * Add `after_publish_page`, `before_publish_page`, `after_unpublish_page` & `before_unpublish_page` hooks (Jonatas Baldin, Coen van der Kamp) * Add convenience `page_url` shortcut to improve how page URLs can be accessed from site settings in Django templates (Andy Babic) * Show more granular error messages from Pillow when uploading images (Rick van Hattem) * Add ordering to `Site` object, so that index page and `Site` switcher will be sorted consistently (Coen van der Kamp, Tim Leguijt) * Add Reddit to oEmbed provider list (Luke Hardwick) * Add ability to replace the default Wagtail logo in the userbar, via `branding_logo` block (Meteor0id) * Add `alt` property to `ImageRenditionField` api representation (Liam Mullens) * Add `purge_revisions` management command to purge old page revisions (Jacob Topp-Mugglestone, Tom Dyson) * Render the Wagtail User Bar on non `Page` views (Caitlin White, Coen van der Kamp) * Add ability to define `form_classname` on `ListBlock` & `StreamBlock` (LB (Ben Johnston)) * Add documentation about how to use `Rustface` for image feature detection (Neal Todd) * Improve performance of public/not_public queries in `PageQuerySet` (Timothy Bautista) * Add `add_redirect` static method to `Redirect` class for programmatic redirect creation (Brylie Christopher Oxley, Lacey Williams Henschel) * Add reference documentation for `wagtail.contrib.redirects` See [Redirects](../reference/contrib/redirects.md#redirects). (LB (Ben Johnston)) * `bulk_delete` page permission is no longer required to move pages, even if those pages have children (Robert Rollins, LB (Ben Johnston)) * Add `after_edit_snippet`, `after_create_snippet` and `after_delete_snippet` hooks and documentation (Kalob Taulien) * Improve performance of empty search results by avoiding downloading the entire search index in these scenarios (Lars van de Kerkhof, Coen van der Kamp) * Replace `gulp-sass` with `gulp-dart-sass` to improve core development across different platforms (Thibaud Colas) * Remove markup around rich text rendering by default, provide a way to use old behavior via `wagtail.contrib.legacy.richtext`. See [Legacy richtext](../reference/contrib/legacy_richtext.md). (Coen van der Kamp, Dan Braghis) * Add `WAGTAIL_TIME_FORMAT` setting (Jacob Topp-Mugglestone) * Apply title length normalisation to improve ranking on PostgreSQL search (Karl Hobley) * Allow omitting the default editor from `WAGTAILADMIN_RICH_TEXT_EDITORS` (Gassan Gousseinov) * Disable password auto-completion on user creation form (Samir Shah) * Upgrade jQuery to version 3.5.1 to reduce penetration testing false positives (Matt Westcott) * Add ability to extend `EditHandler` without a children attribute (Seb Brown) * `Page.objects.specific` now gracefully handles pages with missing specific records (Andy Babic) * StreamField ‘add’ buttons are now disabled when maximum count is reached (Max Gabrielsson) * Use underscores for form builder field names to allow use as template variables (Ashia Zawaduk, LB (Ben Johnston)) * Deprecate use of unidecode within form builder field names (Michael van Tellingen, LB (Ben Johnston)) * Improve error feedback when editing a page with a missing model class (Andy Babic) * Change Wagtail tabs implementation to only allow slug-formatted tab identifiers, reducing false positives from security audits (Matt Westcott) * Ensure errors during Postgres search indexing are left uncaught to assist troubleshooting (Karl Hobley) * Add ability to edit images and embeds in rich text editor (Maylon Pedroso, Samuel Mendes, Gabriel Peracio) ### Bug fixes * Ensure link to add a new user works when no users are visible in the users list (LB (Ben Johnston)) * `AbstractEmailForm` saved submission fields are now aligned with the email content fields, `form.cleaned_data` will be used instead of `form.fields` (Haydn Greatnews) * Removed ARIA `role="table"` from TableBlock output (Thibaud Colas) * Set Cache-Control header to prevent page preview responses from being cached (Tomas Walch) * Accept unicode characters in slugs on the “copy page” form (François Poulain) * Support IPv6 domain (Alex Gleason, Coen van der Kamp) * Remove top padding when `FieldRowPanel` is used inside a `MultiFieldPanel` (Jérôme Lebleu) * Add Wagtail User Bar back to page previews and ensure moderation actions are available (Coen van der Kamp) * Fix issue where queryset annotations were lost (e.g. `.annotate_score()`) when using specific models in page query (Dan Bentley) * Prevent date/time picker from losing an hour on losing focus when 12-hour times are in use (Jacob Topp-Mugglestone) * Strip out HTML tags from `RichTextField` & `RichTextBlock` search index content (Timothy Bautista) * Avoid using null on string `Site.site_name` blank values to avoid different values for no name (Coen van der Kamp) * Fix deprecation warnings on Elasticsearch 7 (Yngve Høiseth) * Remove use of Node.forEach for IE 11 compatibility in admin menu items (Thibaud Colas) * Fix incorrect method name in SiteMiddleware deprecation warning (LB (Ben Johnston)) * `wagtail.contrib.sitemaps` no longer depends on SiteMiddleware (Matt Westcott) * Purge image renditions cache when renditions are deleted (Pascal Widdershoven, Matt Westcott) * Image / document forms now display non-field errors such as `unique_together` constraints (Matt Westcott) * Make “Site” chooser in site settings translatable (Andreas Bernacca) * Fix group permission checkboxes not being clickable in IE11 (LB (Ben Johnston)) ## Upgrade considerations ### Removed support for Python 3.5 Python 3.5 is no longer supported as of this release; please upgrade to Python 3.6 or above before upgrading Wagtail. ### Move to new configurable moderation system (workflow) A new workflow system has been introduced for moderation. Task types are defined as models in code, and instances - tasks - are created in the Wagtail Admin, then chained together to form workflows: sequences of moderation stages through which a page must pass prior to publication. Key points: * Prior to 2.10, moderation in Wagtail was performed on a per-revision basis: once submitted, the moderator would approve or reject the submitted revision only, which would not include subsequent changes. Moderation is now performed per page, with moderators always seeing the latest revision. * `PageRevision.submitted_for_moderation` will return `True` for revisions passing through the old moderation system, but not for the new system * Pages undergoing moderation in the old system will not have their moderation halted, and can still be approved/rejected. As a result, you may see two sets of moderation dashboard panels until there are no longer any pages in moderation in the old system * No pages can be submitted for moderation in the old system: “Submit for moderation” now submits to the new Workflow system * You no longer need the publish permission to perform moderation actions on a page - actions available to each user are now configured per task. With the built in `GroupApprovalTask`, anybody in a specific set of groups can approve or reject the task. * A data migration is provided to recreate your existing publish-permission based moderation workflow in the new system. If you have made no permissions changes, this should simply create a task approvable by anybody in the Moderators group, and assign a workflow with this task to the root page, creating a standard workflow for the entire page tree. However, if you have a complex nested set of publish page permissions, the created set of workflows will be more complex as well - you may wish to inspect the created workflows and tasks in the new `Settings/Workflows` admin area and potentially simplify them. See our How-to: [Configure workflows for moderation](https://guide.wagtail.org/en-latest/how-to-guides/configure-workflows-for-moderation/) for the administrator guide. ### `
` wrappers removed from rich text In previous releases, rich text values were enclosed in a `
` element when rendered; this element has now been removed. To restore the old behaviour, see [Legacy richtext](../reference/contrib/legacy_richtext.md). ### Prepopulating data for site history report This release introduces logging of user actions, viewable through the “Site history” report. To pre-populate these logs with data from page revision history, run the management command: `./manage.py create_log_entries_from_revisions`. ### `clean_name` field added to form builder form field models A `clean_name` field has been added to form field models that extend `AbstractForm`. This is used as the name attribute of the HTML form field, and the dictionary key that the submitted form data is stored under. Storing this on the model (rather than calculating it on-the-fly as was done previously) ensures that if the algorithm for generating the clean name changes in future, the existing data will not become inaccessible. A future version of Wagtail will drop the `unidecode` library currently used for this. For forms created through the Wagtail admin interface, no action is required, as the new field will be populated on server startup. However, any process that creates form pages through direct insertion on the database (such as loading from fixtures) should now be updated to populate `clean_name`. ### New `next_url` keyword argument on `register_page_listing_buttons` and `register_page_listing_more_buttons` hooks Functions registered through the hooks `register_page_listing_buttons` and `register_page_listing_more_buttons` now accept an additional keyword argument `next_url`. A hook function currently written as: ```python @hooks.register('register_page_listing_buttons') def page_listing_more_buttons(page, page_perms, is_parent=False): yield wagtailadmin_widgets.Button( 'My button', '/goes/to/a/url/', priority=60 ) ``` should now become: ```python @hooks.register('register_page_listing_buttons') def page_listing_more_buttons(page, page_perms, is_parent=False, next_url=None): yield wagtailadmin_widgets.Button( 'My button', '/goes/to/a/url/', priority=60 ) ``` The `next_url` argument specifies a URL to redirect back to after the action is complete, and can be passed as a query parameter to the linked URL, if the view supports it. # 2.11.1.html.md # Wagtail 2.11.1 release notes *November 6, 2020* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes * Ensure that cached `wagtail_site_root_paths` structures from older Wagtail versions are invalidated (Sævar Öfjörð Magnússon) * Avoid circular import between wagtail.admin.auth and custom user models (Matt Westcott) * Prevent error on resolving page URLs when a locale outside of `WAGTAIL_CONTENT_LANGUAGES` is active (Matt Westcott) # 2.11.2.html.md # Wagtail 2.11.2 release notes *November 17, 2020* > * [What’s new](#what-s-new) ## What’s new ### Facebook and Instagram embed finders Two new embed finders have been added for Facebook and Instagram, to replace the previous configuration using Facebook’s public oEmbed endpoint which was retired in October 2020. These require a Facebook developer API key - for details of configuring this, see [Facebook and Instagram](../advanced_topics/embeds.md#facebook-and-instagram-embeds). This feature was developed by Cynthia Kiser and Luis Nell. ### Bug fixes * Improve performance of permission check on translations for edit page (Karl Hobley) * Gracefully handle missing Locale records on `Locale.get_active` and `.localized` (Matt Westcott) * Handle `get_supported_language_variant` returning a language variant not in `LANGUAGES` (Matt Westcott) * Reinstate missing icon on settings edit view (Jérôme Lebleu) * Avoid performance and pagination logic issues with a large number of languages (Karl Hobley) * Allow deleting the default locale (Matt Westcott) # 2.11.3.html.md # Wagtail 2.11.3 release notes *December 10, 2020* > * [What’s new](#what-s-new) > * [Upgrade considerations](#upgrade-considerations) ## What’s new ### Bug fixes * Updated project template migrations to ensure that initial homepage creation runs before addition of locale field (Dan Braghis) * Restore ability to use translatable strings in `LANGUAGES` / `WAGTAIL_CONTENT_LANGUAGES` settings (Andreas Morgenstern) * Allow `locale` / `translation_of` API filters to be used in combination with search (Matt Westcott) * Prevent error on `create_log_entries_from_revisions` when checking publish state on a revision that cannot be restored (Kristin Riebe) ## Upgrade considerations ### `run_before` declaration needed in initial homepage migration The migration that creates the initial site homepage needs to be updated to ensure that will continue working under Wagtail 2.11. If you have kept the `home` app from the original project layout generated by the `wagtail start` command, this will be `home/migrations/0002_create_homepage.py`. Inside the `Migration` class, add the line `run_before = [('wagtailcore', '0053_locale_model')]` - for example: ```python # ... class Migration(migrations.Migration): run_before = [ ('wagtailcore', '0053_locale_model'), # added for Wagtail 2.11 compatibility ] dependencies = [ ('home', '0001_initial'), ] operations = [ migrations.RunPython(create_homepage, remove_homepage), ] ``` This fix applies to any migration that creates page instances programmatically. If you installed Wagtail into an existing Django project by following the instructions at [Integrating Wagtail into a Django project](../getting_started/integrating_into_django.md), you most likely created the initial homepage manually, and no change is required in this case. **Further background:** Wagtail 2.11 adds a `locale` field to the Page model, and since the existing migrations in your project pre-date this, they are designed to run against a version of the Page model that has no `locale` field. As a result, they need to run before the new migrations that have been added to `wagtailcore` within Wagtail 2.11. However, in the old version of the homepage migration, there is nothing to ensure that this sequence is followed. The actual order chosen is an internal implementation detail of Django, and in particular is liable to change as you continue developing your project under Wagtail 2.11 and create new migrations that depend on the current state of `wagtailcore`. In this situation, a user installing your project on a clean database may encounter the following error when running `manage.py migrate`: ```default django.db.utils.IntegrityError: NOT NULL constraint failed: wagtailcore_page.locale_id ``` Adding the `run_before` directive will ensure that the migrations run in the intended order, avoiding this error. # 2.11.4.html.md # Wagtail 2.11.4 release notes *February 16, 2021* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes * Prevent delete button showing on collection / workflow edit views when delete permission is absent (Helder Correia) * Ensure aliases are published when the source page is published (Karl Hobley) * Make page privacy rules apply to aliases (Karl Hobley) # 2.11.5.html.md # Wagtail 2.11.5 release notes *February 18, 2021* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes > * Pin django-treebeard to <4.5 to prevent migration conflicts (Matt Westcott) # 2.11.6.html.md # Wagtail 2.11.6 release notes *March 5, 2021* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes > * Un-pin django-treebeard following upstream fix for migration issue (Matt Westcott) > * Prevent crash when copying an alias page (Karl Hobley) > * Prevent errors on page editing after changing LANGUAGE_CODE (Matt Westcott) > * Correctly handle model inheritance and `ClusterableModel` on `copy_for_translation` (Karl Hobley) # 2.11.7.html.md # Wagtail 2.11.7 release notes *April 19, 2021* > * [What’s new](#what-s-new) ## What’s new ### CVE-2021-29434: Improper validation of URLs (‘Cross-site Scripting’) in rich text fields 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. # 2.11.8.html.md # Wagtail 2.11.8 release notes *June 17, 2021* > * [What’s new](#what-s-new) ## What’s new ### CVE-2021-32681: Improper escaping of HTML (‘Cross-site Scripting’) in Wagtail StreamField blocks 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](https://github.com/wagtail/wagtail/security/advisories/GHSA-xfrw-hxr5-ghqf). # 2.11.9.html.md # Wagtail 2.11.9 release notes *January 24, 2022* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes > * Update Pillow dependency to allow 9.x (Rizwan Mansuri) # 2.11.html.md # Wagtail 2.11 (LTS) release notes *November 2, 2020* > * [What’s new](#what-s-new) > * [Upgrade considerations](#upgrade-considerations) Wagtail 2.11 is designated a Long Term Support (LTS) release. Long Term Support releases will continue to receive maintenance updates as necessary to address security and data-loss related issues, up until the next LTS release (typically a period of 12 months). ## What’s new ### Multi-lingual content With this release, Wagtail now has official support for authoring content for multiple languages/regions. To find out more about this feature, see [Multi-language content](../advanced_topics/i18n.md#multi-language-content). We have also developed a new plugin for translating content between different locales called `wagtail-localize`. You can find details about `wagtail-localize` on its [GitHub page](https://github.com/wagtail/wagtail-localize). This feature was sponsored by The Mozilla Foundation and Torchbox. ### Page aliases This release introduces support for creating page aliases. Page aliases are exact copies of another page that sit in another part of the tree. They remain in sync with the original page until this link is removed by converting them into a regular page, or deleting the original page. A page alias can be created through the “Copy Page” UI by selecting the “Alias” checkbox when creating a page copy. This feature was sponsored by The Mozilla Foundation. ### Collections hierarchy Collections (for organising images, documents or other media) can now be managed as a hierarchy rather than a flat list. This feature was developed by Robert Rollins. ### Other features * Add `before_edit_snippet`, `before_create_snippet` and `before_delete_snippet` hooks and documentation (Karl Hobley. Sponsored by the Mozilla Foundation) * Add `register_snippet_listing_buttons` and `construct_snippet_listing_buttons` hooks and documentation (Karl Hobley. Sponsored by the Mozilla Foundation) * Add `wagtail --version` to available Wagtail CLI commands (Kalob Taulien) * Add `hooks.register_temporarily` utility function for testing hooks (Karl Hobley. Sponsored by the Mozilla Foundation) * Remove `unidecode` and use `anyascii` in for Unicode to ASCII conversion (Robbie Mackay) * Add `render` helper to `RoutablePageMixin` to support serving template responses according to Wagtail conventions (Andy Babic) * Specify minimum Python version in setup.py (Vince Salvino) * Extend treebeard’s `fix_tree` method with the ability to non-destructively fix path issues and add a –full option to apply path fixes (Matt Westcott) * Add support for hierarchical/nested Collections (Robert Rollins) * Show user’s full name in report views (Matt Westcott) * Improve Wagtail admin page load performance by caching SVG icons sprite in localStorage (Coen van der Kamp) * Support SVG icons in ModelAdmin menu items (Scott Cranfill) * Support SVG icons in admin breadcrumbs (Coen van der Kamp) * Serve PDFs inline in the browser (Matt Westcott) * Make document `content-type` and `content-disposition` configurable via `WAGTAILDOCS_CONTENT_TYPES` and `WAGTAILDOCS_INLINE_CONTENT_TYPES` (Matt Westcott) * Slug generation no longer removes stopwords (Andy Chosak, Scott Cranfill) * Add check to disallow StreamField block names that do not match Python variable syntax (François Poulain) * The `BASE_URL` setting is now converted to a string, if it isn’t already, when constructing API URLs (thenewguy) * Preview from ‘pages awaiting moderation’ now opens in a new window (Cynthia Kiser) * Add document extension validation if `WAGTAIL_DOCS_EXTENSIONS` is set to a list of allowed extensions (Meghana Bhange) * Use `django-admin` command in place of `django-admin.py` (minusf) * Add `register_snippet_action_menu_item` and `construct_snippet_action_menu` hooks to modify the actions available when creating / editing a snippet (Karl Hobley) * Moved `generate_signature` and `verify_signature` functions into `wagtail.images.utils` (Noah H) * Implement `bulk_to_python` on all structural StreamField block types (Matt Westcott) * Add natural key support to `GroupCollectionPermission` (Jim Jazwiecki) * Implement `prepopulated_fields` for `wagtail.contrib.modeladmin` (David Bramwell) * Change `classname` keyword argument on basic StreamField blocks to `form_classname` (Meghana Bhange) * Replace page explorer pushPage/popPage with gotoPage for more flexible explorer navigation (Karl Hobley) ### Bug fixes * Make page-level actions accessible to keyboard users in page listing tables (Jesse Menn) * `WAGTAILFRONTENDCACHE_LANGUAGES` was being interpreted incorrectly. It now accepts a list of strings, as documented (Karl Hobley) * Update oEmbed endpoints to use https where available (Matt Westcott) * Revise `edit_handler` bind order in ModelAdmin views and fix duplicate form instance creation (Jérôme Lebleu) * Properly distinguish child blocks when comparing revisions with nested StreamBlocks (Martin Mena) * Correctly handle Turkish ‘İ’ characters in client-side slug generation (Matt Westcott) * Page chooser widgets now reflect custom `get_admin_display_title` methods (Saptak Sengupta) * `Page.copy()` now raises an error if the page being copied is unsaved (Anton Zhyltsou) * `Page.copy()` now triggers a `page_published` if the copied page is live (Anton Zhyltsou) * The Elasticsearch `URLS` setting can now take a string on its own instead of a list (Sævar Öfjörð Magnússon) * Avoid retranslating month / weekday names that Django already provides (Matt Westcott) * Fixed padding around checkbox and radio inputs (Cole Maclean) * Fix spacing around the privacy indicator panel (Sævar Öfjörð Magnússon, Dan Braghis) * Consistently redirect to admin home on permission denied (Matt Westcott, Anton Zhyltsou) ## Upgrade considerations ### `run_before` declaration needed in initial homepage migration The migration that creates the initial site homepage needs to be updated to ensure that will continue working under Wagtail 2.11. If you have kept the `home` app from the original project layout generated by the `wagtail start` command, this will be `home/migrations/0002_create_homepage.py`. Inside the `Migration` class, add the line `run_before = [('wagtailcore', '0053_locale_model')]` - for example: ```python # ... class Migration(migrations.Migration): run_before = [ ('wagtailcore', '0053_locale_model'), # added for Wagtail 2.11 compatibility ] dependencies = [ ('home', '0001_initial'), ] operations = [ migrations.RunPython(create_homepage, remove_homepage), ] ``` This fix applies to any migration that creates page instances programmatically. If you installed Wagtail into an existing Django project by following the instructions at [Integrating Wagtail into a Django project](../getting_started/integrating_into_django.md), you most likely created the initial homepage manually, and no change is required in this case. **Further background:** Wagtail 2.11 adds a `locale` field to the Page model, and since the existing migrations in your project pre-date this, they are designed to run against a version of the Page model that has no `locale` field. As a result, they need to run before the new migrations that have been added to `wagtailcore` within Wagtail 2.11. However, in the old version of the homepage migration, there is nothing to ensure that this sequence is followed. The actual order chosen is an internal implementation detail of Django, and in particular is liable to change as you continue developing your project under Wagtail 2.11 and create new migrations that depend on the current state of `wagtailcore`. In this situation, a user installing your project on a clean database may encounter the following error when running `manage.py migrate`: ```default django.db.utils.IntegrityError: NOT NULL constraint failed: wagtailcore_page.locale_id ``` Adding the `run_before` directive will ensure that the migrations run in the intended order, avoiding this error. ### IE11 support being phased out This release begins the process of phasing out support for Internet Explorer. ### SiteMiddleware moved to `wagtail.contrib.legacy` The SiteMiddleware class (which provides the `request.site` property, and has been deprecated since Wagtail 2.9) has been moved to the `wagtail.contrib.legacy` namespace. On projects where this is still in use, the `'wagtail.core.middleware.SiteMiddleware'` entry in `MIDDLEWARE` should be changed to `'wagtail.contrib.legacy.sitemiddleware.SiteMiddleware'`. ### Collection model enforces alphabetical ordering As part of the hierarchical collections support, the `path` field on the Collection model now enforces alphabetical ordering. Previously, collections were stored in the order in which they were created - and then sorted by name where displayed in the CMS. This change will be handled automatically through migrations when upgrading to Wagtail 2.11. However, if your project creates new collections programmatically after migrations have run, and assigns the `path` field directly - for example, by loading from a fixture file - this code will need to be updated to insert them in alphabetical order. Otherwise, errors may occur when subsequently adding new collections through the Wagtail admin. This can be done as follows: * Update paths to match alphabetical order. For example, if you have a fixture that creates the collections `Zebras` and `Aardvarks` with paths `00010001` and `00010002` respectively, these paths should be swapped. * *Alternatively*, after creating the collections, run the Python code: ```python from wagtail.core.models import Collection Collection.fix_tree(fix_paths=True) ``` or the management command: ```console python manage.py fixtree --full ``` ### `Site.get_site_root_paths` now returns language code In previous releases, `Site.get_site_root_paths` returned a list of `(site_id, root_path, root_url)` tuples. To support the new internationalisation model, this has now been changed to a list of named tuples with the fields: `site_id`, `root_path`, `root_url` and `language_code`. Existing code that handled this as a 3-tuple should be updated accordingly. ### `classname` argument on StreamField blocks is now `form_classname` Basic StreamField block types such as CharBlock previously accepted a `classname` keyword argument, to specify a `class` attribute to appear on the page editing form. For consistency with StructBlock, this has now been changed to `form_classname`. The `classname` argument is still recognised, but deprecated. # 2.12.1.html.md # Wagtail 2.12.1 release notes *February 16, 2021* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes * Ensure aliases are published when the source page is published (Karl Hobley) * Make page privacy rules apply to aliases (Karl Hobley) * Prevent error when saving embeds that do not include a thumbnail URL (Cynthia Kiser) * Ensure that duplicate embed records are deleted when upgrading (Matt Westcott) * Prevent failure when running `manage.py dumpdata` with no arguments (Matt Westcott) # 2.12.2.html.md # Wagtail 2.12.2 release notes *February 18, 2021* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes > * Pin django-treebeard to <4.5 to prevent migration conflicts (Matt Westcott) # 2.12.3.html.md # Wagtail 2.12.3 release notes *March 5, 2021* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes > * Un-pin django-treebeard following upstream fix for migration issue (Matt Westcott) > * Prevent crash when copying an alias page (Karl Hobley) > * Prevent errors on page editing after changing LANGUAGE_CODE (Matt Westcott) > * Correctly handle model inheritance and `ClusterableModel` on `copy_for_translation` (Karl Hobley) # 2.12.4.html.md # Wagtail 2.12.4 release notes *April 19, 2021* > * [What’s new](#what-s-new) ## What’s new ### CVE-2021-29434: Improper validation of URLs (‘Cross-site Scripting’) in rich text fields 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. ### Bug fixes * Prevent reverse migration errors in images and documents (Mike Brown) * Avoid wagtailembeds migration failure on MySQL 8.0.13+ (Matt Westcott) # 2.12.5.html.md # Wagtail 2.12.5 release notes *June 17, 2021* > * [What’s new](#what-s-new) ## What’s new ### CVE-2021-32681: Improper escaping of HTML (‘Cross-site Scripting’) in Wagtail StreamField blocks 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](https://github.com/wagtail/wagtail/security/advisories/GHSA-xfrw-hxr5-ghqf). # 2.12.6.html.md # Wagtail 2.12.6 release notes *July 13, 2021* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes > * Prevent embed thumbnail_url migration from failing on URLs longer than 200 characters (Matt Westcott) # 2.12.html.md # Wagtail 2.12 release notes *February 2, 2021* > * [What’s new](#what-s-new) > * [Upgrade considerations](#upgrade-considerations) ## What’s new ### Image / document choose permission Images and documents now support a distinct ‘choose’ permission type, to control the set of items displayed in the chooser interfaces when inserting images and documents into a page, and allow setting up collections that are only available for use by specific user groups. This feature was developed by Robert Rollins. ### In-place StreamField updating StreamField values now formally support being updated in-place from Python code, allowing blocks to be inserted, modified and deleted rather than having to assign a new list of blocks to the field. For further details, see [Modifying StreamField data](../topics/streamfield.md#modifying-streamfield-data). This feature was developed by Matt Westcott. ### Admin colour themes Wagtail’s admin now uses CSS custom properties for its primary teal colour. Applying brand colours for the whole user interface only takes a few lines of CSS, and third-party extensions can reuse Wagtail’s CSS variables to support the same degree of customization. Read on [Custom user interface colors](../advanced_topics/customization/admin_templates.md#custom-user-interface-colors). This feature was developed by Joshua Marantz. ### Other features * Added support for Python 3.9 * Added `WAGTAILIMAGES_IMAGE_FORM_BASE` and `WAGTAILDOCS_DOCUMENT_FORM_BASE` settings to customize the forms for images and documents (Dan Braghis) * Switch pagination icons to use SVG instead of icon fonts (Scott Cranfill) * Added string representation to image Format class (Andreas Nüßlein) * Support returning None from `register_page_action_menu_item` and `register_snippet_action_menu_item` to skip registering an item (Vadim Karpenko) * Fields on a custom image model can now be defined as required / `blank=False` (Matt Westcott) * Add combined index for Postgres search backend (Will Giddens) * Add `Page.specific_deferred` property for accessing specific page instance without up-front database queries (Andy Babic) * Add hash lookup to embeds to support URLs longer than 255 characters (Coen van der Kamp) ### Bug fixes * Stop menu icon overlapping the breadcrumb on small viewport widths in page editor (Karran Besen) * Make sure document chooser pagination preserves the selected collection when moving between pages (Alex Sa) * Gracefully handle oEmbed endpoints returning non-JSON responses (Matt Westcott) * Fix unique constraint on WorkflowState for SQL Server compatibility (David Beitey) * Reinstate chevron on collection dropdown (Mike Brown) * Prevent delete button showing on collection / workflow edit views when delete permission is absent (Helder Correia) * Move labels above the form field in the image format chooser, to avoid styling issues at tablet size (Helen Chapman) * `{% include_block with context %}` now passes local variables into the block template (Jonny Scholes) ## Upgrade considerations ### Removed support for Elasticsearch 2 Elasticsearch version 2 is no longer supported as of this release; please upgrade to Elasticsearch 5 or above before upgrading Wagtail. ### `stream_data` on StreamField values is deprecated The `stream_data` property of StreamValue is commonly used to access the underlying data of a StreamField. However, this is discouraged, as it is an undocumented internal attribute and has different data representations depending on whether the value originated from the database or in memory, typically leading to errors on preview if this has not been properly accounted for. As such, `stream_data` is now deprecated. The recommended alternative is to index the StreamField value directly as a list; for example, `page.body[0].block_type` and `page.body[0].value` instead of `page.body.stream_data[0]['type']` and `page.body.stream_data[0]['value']`. This has the advantage that it will return the same Python objects as when the StreamField is used in template code (such as Page instances for `PageChooserBlock`). However, in most cases, existing code using `stream_data` is written to expect the raw JSON-like representation of the data, and for this the new property `raw_data` (added in Wagtail 2.12) can be used as a drop-in replacement for `stream_data`. # 2.13.1.html.md # Wagtail 2.13.1 release notes *June 1, 2021* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes > * 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) # 2.13.2.html.md # Wagtail 2.13.2 release notes *June 17, 2021* > * [What’s new](#what-s-new) ## What’s new ### CVE-2021-32681: Improper escaping of HTML (‘Cross-site Scripting’) in Wagtail StreamField blocks 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](https://github.com/wagtail/wagtail/security/advisories/GHSA-xfrw-hxr5-ghqf). # 2.13.3.html.md # Wagtail 2.13.3 release notes *July 5, 2021* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes > * 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) # 2.13.4.html.md # Wagtail 2.13.4 release notes *July 13, 2021* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes > * Prevent embed thumbnail_url migration from failing on URLs longer than 200 characters (Matt Westcott) # 2.13.5.html.md # Wagtail 2.13.5 release notes *October 14, 2021* > * [What’s new](#what-s-new) > * [Upgrade considerations](#upgrade-considerations) ## What’s new ### Bug fixes > * 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) ## Upgrade considerations ### Customizing relation name for admin comments 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: ```python 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: ```python try: from wagtail.core.models import COMMENTS_RELATION_NAME except ImportError: COMMENTS_RELATION_NAME = 'comments' ``` # 2.13.html.md # Wagtail 2.13 release notes *May 12, 2021* > * [What’s new](#what-s-new) > * [Upgrade considerations](#upgrade-considerations) > * [Feedback](#feedback) ## What’s new ### StreamField performance and functionality updates The StreamField editing interface has been rebuilt on a client-side rendering model, powered by the [telepath](https://wagtail.github.io/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](https://wagtail.org/blog/telepath/). This feature was developed by Matt Westcott and Karl Hobley and sponsored by [YouGov](https://yougov.co.uk/), inspired by earlier work on [react-streamfield](https://github.com/wagtail/wagtail-react-streamfield) completed by Bertrand Bordage through the [Wagtail’s First Hatch](https://www.kickstarter.com/projects/noripyt/wagtails-first-hatch) crowdfunder. ### Simple translation module 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](https://www.wagtail-localize.org). In this release, a new contrib app has been introduced called [simple_translation](../reference/contrib/simple_translation.md). 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. ### Commenting 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](https://www.fool.com/). ### Combined account settings 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. ### Redirect export The redirects module now includes support for exporting the list of redirects to XLSX or CSV. This feature was developed by Martin Sandström. ### Sphinx Wagtail Theme The [documentation](https://docs.wagtail.org/) now uses our brand new [Sphinx Wagtail Theme](https://github.com/wagtail/sphinx_wagtail_theme), with a search feature powered by [Algolia DocSearch](https://docsearch.algolia.com/). Feedback and feature requests for the theme may be reported to the [sphinx_wagtail_theme issue list](https://github.com/wagtail/sphinx_wagtail_theme/issues), 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 support Django 3.2 is formally supported in this release. Note that Wagtail 2.13 will be the last release to support Django 2.2. ### Other features * 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) ### Bug fixes * 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) ## Upgrade considerations ### End of Internet Explorer 11 support 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. ### Updated handling of non-required StreamFields 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. ### New client-side implementation for custom StreamField blocks 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](../advanced_topics/customization/streamfield_blocks.md#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 [How to build custom StreamField blocks](../advanced_topics/customization/streamfield_blocks.md#custom-streamfield-blocks). ### Switched `register_setting`, `register_settings_menu_item` to use SVG icons 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: ```python # 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') ``` ### `CommentPanel` `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: ```python 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(), ] ``` ## Feedback We would love to [receive your feedback](https://forms.gle/G5WYo6sLiZiwdfsQA) on this release. # 2.14.1.html.md # Wagtail 2.14.1 release notes *August 12, 2021* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes > * 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) # 2.14.2.html.md # Wagtail 2.14.2 release notes *October 14, 2021* > * [What’s new](#what-s-new) > * [Upgrade considerations](#upgrade-considerations) ## What’s new ### Bug fixes > * 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) ## Upgrade considerations ### Customizing relation name for admin comments 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: ```python 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: ```python try: from wagtail.core.models import COMMENTS_RELATION_NAME except ImportError: COMMENTS_RELATION_NAME = 'comments' ``` # 2.14.html.md # Wagtail 2.14 release notes *August 2, 2021* > * [What’s new](#what-s-new) > * [Upgrade considerations](#upgrade-considerations) ## What’s new ### New features > * Added `ancestor_of` API filter. See [Filtering by tree position (pages only)](../advanced_topics/api/v2/usage.md#apiv2-filter-by-tree-position). (Jaap Roes) > * Added support for customizing group management views. See [Customizing group edit/create views](../extending/customizing_group_views.md#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) ### Bug fixes > * 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) ## Upgrade considerations ### Removed support for Django 2.2 Django 2.2 is no longer supported as of this release; please upgrade to Django 3.0 or above before upgrading Wagtail. ### User bar with keyboard and screen reader support 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 ``, so users can reach it without having to go through the whole page. See [Wagtail user bar](../topics/writing_templates.md#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](../reference/hooks.md#construct-wagtail-userbar) for more information. ### Deprecation of Facebook / Instagram oEmbed product As of June 2021, the procedure for setting up a Facebook app to handle Facebook / Instagram embedded content (see [Facebook and Instagram](../advanced_topics/embeds.md#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. # 2.15.1.html.md # Wagtail 2.15.1 release notes *November 11, 2021* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes > * 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) # 2.15.2.html.md # Wagtail 2.15.2 release notes *January 18, 2022* > * [What’s new](#what-s-new) > * [Upgrade considerations](#upgrade-considerations) ## What’s new ### CVE-2022-21683: Comment reply notifications sent to incorrect users 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](https://github.com/wagtail/wagtail/security/advisories/GHSA-xqxm-2rpm-3889). ### Bug fixes > * 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) ## Upgrade considerations ### Support for SQLite without full-text search support 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: ```console ./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. # 2.15.3.html.md # Wagtail 2.15.3 release notes *January 26, 2022* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes > * Implement correct check for SQLite installations without full-text search support (Matt Westcott) # 2.15.4.html.md # Wagtail 2.15.4 release notes *February 11, 2022* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes > * 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) # 2.15.5.html.md # Wagtail 2.15.5 release notes *April 11, 2022* > * [What’s new](#what-s-new) > * [Upgrade considerations](#upgrade-considerations) ## What’s new ### Bug fixes > * 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) ## Upgrade considerations ### Jinja2 compatibility 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. # 2.15.6.html.md # Wagtail 2.15.6 release notes *September 5, 2022* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes > * 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) # 2.15.html.md # Wagtail 2.15 (LTS) release notes *November 4, 2021* > * [What’s new](#what-s-new) > * [Upgrade considerations](#upgrade-considerations) 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). ## What’s new ### New database search backend 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 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 for all models 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](https://www.fool.com/). ### Collection management permissions 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](../topics/permissions.md#collection-management-permissions). This feature was developed by Cynthia Kiser. ### Typed table block 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 [Typed table block](../reference/contrib/typed_table_block.md). This feature was developed by Matt Westcott, Coen van der Kamp and Scott Cranfill, and sponsored by [YouGov](https://yougov.com/). ### Windows high contrast support As part of a broad push to improve the accessibility of the administration interface, Wagtail now supports [Windows high contrast mode](https://support.microsoft.com/en-us/windows/use-high-contrast-mode-in-windows-10-fedc744c-90ac-69df-aed5-c8a90125e696). 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. ### Other features > * Add the ability for the page chooser to convert external urls that match a page to internal links, see [WAGTAILADMIN_EXTERNAL_LINK_CONVERSION](../reference/settings.md#wagtailadmin-external-link-conversion) (Jacob Topp-Mugglestone. Sponsored by The Motley Fool) > * Added “Extending Wagtail” section to documentation (Matt Westcott) > * Introduced [template components](../extending/template_components.md), 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](../reference/contrib/simple_translation.md) (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 [Setting the background-position inline style based on the focal point](../advanced_topics/images/focal_points.md#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](../reference/panels.md#collapsible) 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) ### Bug fixes > * 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) ## Upgrade considerations ### Database search backends replaced 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: ```python 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](../reference/management_commands.md#update-index)). If you have used the PostgreSQL-specific `SEARCH_CONFIG`, this will continue to work as before with the new backend. For example: ```python 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. ### Admin homepage panels, summary items and action menu items now use components 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](../extending/template_components.md) pattern. The affected objects are: > * Homepage panels (as registered with the [construct_homepage_panels](../reference/hooks.md#construct-homepage-panels) hook) > * Homepage summary items (as registered with the [construct_homepage_summary_items](../reference/hooks.md#construct-homepage-summary-items) hook) > * Page action menu items (as registered with the [register_page_action_menu_item](../reference/hooks.md#register-page-action-menu-item) and [construct_page_action_menu](../reference/hooks.md#construct-page-action-menu) hooks) > * Snippet action menu items (as registered with the [register_snippet_action_menu_item](../reference/hooks.md#register-snippet-action-menu-item) and [construct_snippet_action_menu](../reference/hooks.md#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 components](../extending/template_components.md#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']`. ### Passing callables as messages in `register_log_actions` is deprecated When defining new action types for [audit logging](../extending/audit_log.md#audit-log) with the [register_log_actions](../reference/hooks.md#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: ```python 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: ```python 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'], } ``` ### `PageLogEntry.objects.log_action` is deprecated 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](../extending/audit_log.md#audit-log) for further details. ### Removed support for Internet Explorer (IE11) 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](https://learn.microsoft.com/en-us/deployedge/edge-ie-mode) to keep access to IE11-only sites, while other sites and apps like Wagtail can leverage modern browser capabilities. ### `search()` method partial match future deprecation 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: [Searching QuerySets](../topics/search/searching.md#wagtailsearch-searching-pages) ### Change of relation name for admin comments 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: ```python try: from wagtail.core.models import COMMENTS_RELATION_NAME except ImportError: COMMENTS_RELATION_NAME = 'comments' ``` ### Bulk action views not covered by existing hooks 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](../reference/hooks.md#before-bulk-action) and [after_bulk_action](../reference/hooks.md#after-bulk-action). # 2.16.1.html.md # Wagtail 2.16.1 release notes *February 11, 2022* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes > * 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)) # 2.16.2.html.md # Wagtail 2.16.2 release notes *April 11, 2022* > * [What’s new](#what-s-new) > * [Upgrade considerations](#upgrade-considerations) ## What’s new ### Bug fixes * Update django-treebeard dependency to 4.5.1 or above (Serafeim Papastefanos) * Fix permission error when sorting pages having page type restrictions (Thijs Kramer) * 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) * Refactor `FormPagesListView` in wagtail.contrib.forms to avoid undefined `locale` variable when subclassing (Dan Braghis) * Ensure page copy in Wagtail admin doesn’t ignore `exclude_fields_in_copy` (John-Scott Atlakson) * Generate new translation keys for translatable `Orderable`s when page is copied without being published (Kalob Taulien, Dan Braghis) * Ignore `GenericRelation` when copying pages (John-Scott Atlakson) * Ensure ‘next’ links from image / document listings do not redirect back to partial AJAX view (Matt Westcott) * Skip creation of automatic redirects when page cannot be routed (Matt Westcott) * Prevent JS errors on locale switcher in page chooser (Matt Westcott) ## Upgrade considerations ### Jinja2 compatibility 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. # 2.16.3.html.md # Wagtail 2.16.3 release notes *September 5, 2022* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes * 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) # 2.16.html.md # Wagtail 2.16 release notes *February 7, 2022* > * [What’s new](#what-s-new) > * [Upgrade considerations](#upgrade-considerations) ## What’s new ### Django 4.0 support This release adds support for Django 4.0. ### Slim sidebar As part of a [wider redesign](https://github.com/wagtail/wagtail/discussions/7739) 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](#upgrade-considerations) for more details on differences with the previous version. ### Automatic redirect creation 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: ```python WAGTAILREDIRECTS_AUTO_CREATE = False ``` Thank you to [The National Archives](https://www.nationalarchives.gov.uk) for kindly sponsoring this feature. ### Other features * Added persistent IDs for ListBlock items, allowing commenting and improvements to revision comparisons (Matt Westcott, Tidiane Dia, with sponsorship from [NHS](https://www.nhs.uk/)) * Added Aging Pages report (Tidiane Dia) * Add more SketchFab oEmbed patterns for models (Tom Usher) * Added `page_slug_changed` signal for Pages (Andy Babic) * Add collapse option to `StreamField`, `StreamBlock`, and `ListBlock` which will load all sub-blocks initially collapsed (Matt Westcott) * Private pages can now be fetched over the API (Nabil Khalil) * Added `alias_of` field to the pages API (Dmitrii Faiazov) * Add support for Azure CDN and Front Door front-end cache invalidation (Tomasz Knapik) * Fixed `default_app_config` deprecations for Django >= 3.2 (Tibor Leupold) * Removed WOFF fonts * Improved styling of workflow timeline modal view (Tidiane Dia) * Add secondary actions menu in edit page headers (Tidiane Dia) * Add system check for missing core Page fields in `search_fields` (LB (Ben Johnston)) * Improve CircleCI frontend & backend build caches, add automated browser accessibility test suite in CircleCI (Thibaud Colas) * Add a ‘remember me’ checkbox to the admin sign in form, if unticked (default) the auth session will expire if the browser is closed (Michael Karamuth, Jake Howard) * When returning to image or document listing views after editing, filters (collection or tag) are now remembered (Tidiane Dia) * Improve the visibility of field error messages, in Windows high-contrast mode and out (Jason Attwood) * Improve implementations of visually-hidden text in explorer and main menu toggle (Martin Coote) * Add locale labels to page listings (Dan Braghis) * Add locale labels to page reports (Dan Braghis) * Change release check domain to releases.wagtail.org (Jake Howard) * Add the user who submitted a page for moderation to the “Awaiting your review” homepage summary panel (Tidiane Dia) * When moving pages, default to the current parent section (Tidiane Dia) * Add borders to TypedTableBlock to help visualize rows and columns (Scott Cranfill) * Set default submit button label on generic create views to ‘Create’ instead of ‘Save’ (Matt Westcott) * Improve display of image listing for long image titles (Krzysztof Jeziorny) * Use SVG icons in admin home page site summary items (Jérôme Lebleu) * Ensure site summary items wrap on smaller devices on the admin home page (Jérôme Lebleu) * Rework Workflow task chooser modal to align with other chooser modals, using consistent pagination and leveraging class based views (Matt Westcott) * Implemented a locale switcher on the forms listing page in the admin (Dan Braghis) * Implemented a locale switcher on the page chooser modal (Dan Braghis) * Implemented the `wagtail_site` template tag for Jinja2 (Vladimir Tananko) * Change webmaster to website administrator in the admin (Naomi Morduch Toubman) * Added documentation for creating custom submenus in the admin menu (Sævar Öfjörð Magnússon) * Choice blocks in StreamField now show label rather than value when collapsed (Jérôme Lebleu) * Added documentation to clarify configuration of user-uploaded files (Cynthia Kiser) * Change security contact address to security@wagtail.org (Jake Howard) ### Bug fixes * Accessibility fixes for Windows high contrast mode; Dashboard icons color and contrast, help/error/warning blocks for fields and general content, side comment buttons within the page editor, dropdown buttons (Sakshi Uppoor, Shariq Jamil, LB (Ben Johnston), Jason Attwood) * Rename additional ‘spin’ CSS animations to avoid clashes with other libraries (Kevin Gutiérrez) * Pages are refreshed from database on create before passing to hooks. Page aliases get correct `first_published_date` and `last_published_date` (Dan Braghis) * Additional login form fields from `WAGTAILADMIN_USER_LOGIN_FORM` are now rendered correctly (Michael Karamuth) * Fix icon only button styling issue on small devices where height would not be set correctly (Vu Pham) * Add padding to the Draftail editor to ensure `ol` items are not cut off (Khanh Hoang) * Prevent opening choosers multiple times for Image, Page, Document, Snippet (LB (Ben Johnston)) * Ensure subsequent changes to styles files are picked up by Gulp watch (Jason Attwood) * Ensure that programmatic page moves are correctly logged as ‘move’ and not ‘reorder’ in some cases (Andy Babic) ## Upgrade considerations ### Removed support for Django 3.0 and 3.1 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. ### Removed support for Python 3.6 Python 3.6 is no longer supported as of this release; please upgrade to Python 3.7 or above before upgrading Wagtail. ### StreamField ListBlock now returns `ListValue` rather than a list instance The 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](../advanced_topics/boundblocks_and_values.md) 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: ```python self.assertEqual(page.body[0].value, ['hello', 'goodbye']) ``` should be rewritten as: ```python self.assertEqual(list(page.body[0].value), ['hello', 'goodbye']) ``` ### Change to `set` method on tag fields This release upgrades the [django-taggit](https://django-taggit.readthedocs.io/en/latest/) 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 conventions The internal (undocumented) class-based view `wagtail.admin.views.generic.DeleteView` has been updated to align with [Django 4.0’s `DeleteView` implementation](https://docs.djangoproject.com/en/stable/releases/4.0/#deleteview-changes), which uses `FormMixin` to handle POST requests. Any custom deletion logic in `delete()` handlers should be moved to `form_valid()`. ### Renamed admin/expanding-formset.js `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. ### Deprecated sidebar capabilities The new sidebar largely supports the same customizations as its predecessor, with a few exceptions: - Top-level menu items should now always provide an `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 JavaScript For 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. # 2.2.1.html.md # Wagtail 2.2.1 release notes *August 13, 2018* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes * Pin Beautiful Soup to 4.6.0 due to further regressions in formatting empty elements (Matt Westcott) * Prevent AppRegistryNotReady error when wagtail.contrib.sitemaps is in INSTALLED_APPS (Matt Westcott) # 2.2.2.html.md # Wagtail 2.2.2 release notes *August 29, 2018* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes * Seek to the beginning of image files when uploading, to restore compatibility with django-storages Google Cloud and Azure backends (Mikalai Radchuk) * Respect next param on login (Loic Teixeira) # 2.2.html.md # Wagtail 2.2 release notes *August 10, 2018* > * [What’s new](#what-s-new) > * [Upgrade considerations](#upgrade-considerations) ## What’s new ### Faceted search Wagtail search now includes support for facets, allowing you to display search result counts broken down by a particular field value. For further details, see [Faceted search](../topics/search/searching.md#wagtailsearch-faceted-search). This feature was developed by Karl Hobley. ### Improved admin page search The page search in the Wagtail admin now supports filtering by page type and ordering search results by title, creation date and status. This feature was developed by Karl Hobley. ### Other features * Added another valid AudioBoom oEmbed pattern (Bertrand Bordage) * Added `annotate_score` support to PostgreSQL search backend (Bertrand Bordage) * Pillow’s image optimization is now applied when saving PNG images (Dmitry Vasilev) * JS / CSS media files can now be associated with Draftail feature definitions (Matt Westcott) * The `{% slugurl %}` template tag is now site-aware (Samir Shah) * Added `file_size` field to documents (Karl Hobley) * Added `file_hash` field to images (Karl Hobley) * Update documentation (configuring Django for Wagtail) to contain all current settings options (Matt Westcott, LB (Ben Johnston)) * Added `defer` flag to `PageQuerySet.specific` (Karl Hobley) * Snippets can now be deleted from the listing view (LB (Ben Johnston)) * Increased max length of redirect URL field to 255 (Michael Harrison) * Added documentation for new JS/CSS media files association with Draftail feature definitions (Ed Henderson) * Added accessible color contrast guidelines to the style guide (Catherine Farman) * Admin modal views no longer rely on JavaScript `eval()`, for better CSP compliance (Matt Westcott) * Update editor guide for embeds and documents in rich text (Kevin Howbrook) * Improved performance of sitemap generation (Michael van Tellingen, Bertrand Bordage) * Added an internal API for autocomplete (Karl Hobley) ### Bug fixes * Handle all exceptions from `Image.get_file_size` (Andrew Plummer) * Fix display of breadcrumbs in ModelAdmin (LB (Ben Johnston)) * Remove duplicate border radius of avatars (Benjamin Thurm) * Site.get_site_root_paths() preferring other sites over the default when some sites share the same root_page (Andy Babic) * Pages with missing model definitions no longer crash the API (Abdulmalik Abdulwahab) * Rich text image chooser no longer skips format selection after a validation error (Matt Westcott) * Null characters in URLs no longer crash the redirect middleware on PostgreSQL (Andrew Crewdson, Matt Westcott) * Permission checks no longer prevent a non-live page from being unscheduled (Abdulmalik Abdulwahab) * Copy-paste between Draftail editors now preserves all formatting/content (Thibaud Colas) * Fix alignment of checkboxes and radio buttons on Firefox (Matt Westcott) ## Upgrade considerations ### JavaScript templates in modal workflows are deprecated The `wagtail.admin.modal_workflow` module (used internally by Wagtail to handle modal popup interfaces such as the page chooser) has been updated to avoid returning JavaScript code as part of HTTP responses. User code that relies on this functionality can be updated as follows: * Eliminate template tags from the .js template. Any dynamic data needed by the template can instead be passed in a dict to `render_modal_workflow`, as a keyword argument `json_data`; this data will then be available as the second parameter of the JavaScript function. * At the point where you call the `ModalWorkflow` constructor, add an `onload` option - a dictionary of functions to be called on loading each step of the workflow. Move the code from the .js template into this dictionary. Then, on the call to `render_modal_workflow`, rather than passing the .js template name (which should now be replaced by `None`), pass a `step` item in the `json_data` dictionary to indicate the `onload` function to be called. Additionally, if your code calls `loadResponseText` as part of a jQuery AJAX callback, this should now be passed all three arguments from the callback (the response data, status string and XMLHttpRequest object). ### `Page.get_sitemap_urls()` now accepts an optional `request` keyword argument The `Page.get_sitemap_urls()` method used by the `wagtail.contrib.sitemaps` module has been updated to receive an optional `request` keyword argument. If you have overridden this method in your page models, you will need to update the method signature to accept this argument (and pass it on when calling `super`, if applicable). # 2.3.html.md # Wagtail 2.3 (LTS) release notes *October 23, 2018* > * [What’s new](#what-s-new) > * [Upgrade considerations](#upgrade-considerations) Wagtail 2.3 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 8 months). Note that Wagtail 2.3 will be the last release branch to support Django 1.11. ## What’s new ### Added Django 2.1 support Wagtail is now compatible with Django 2.1. Compatibility fixes were contributed by Ryan Verner and Matt Westcott. ### Improved color contrast Colour contrast within the admin interface has been improved, and now complies with WCAG 2 level AA. This was completed by Coen van der Kamp and Naomi Morduch Toubman based on earlier work from Edd Baldry, Naa Marteki Reed and Ben Enright. ### Other features * Added ‘scale’ image filter (Oliver Wilkerson) * Added meta tag to prevent search engines from indexing admin pages (Karl Hobley) * EmbedBlock now validates against recognized embed providers on save (Bertrand Bordage) * Made cache control headers on Wagtail admin consistent with Django admin (Tomasz Knapik) * Notification emails now include an “Auto-Submitted: auto-generated” header (Dan Braghis) * Image chooser panels now show alt text as title (Samir Shah) * Added `download_url` field to images in the API (Michael Harrison) * Dummy requests for preview now preserve the HTTP Authorization header (Ben Dickinson) ### Bug fixes * Respect next param on login (Loic Teixeira) * InlinePanel now handles relations that specify a related_query_name (Aram Dulyan) * before_delete_page / after_delete_page hooks now run within the same database transaction as the page deletion (Tomasz Knapik) * Seek to the beginning of image files when uploading, to restore compatibility with django-storages Google Cloud and Azure backends (Mikalai Radchuk) * Snippet chooser modal no longer fails on snippet models with UUID primary keys (Sævar Öfjörð Magnússon) * Restored localization in date/time pickers (David Moore, Thibaud Colas) * Tag input field no longer treats ‘б’ on Russian keyboards as a comma (Michael Borisov) * Disabled autocomplete dropdowns on date/time chooser fields (Janneke Janssen) * Split up `wagtail.admin.forms` to make it less prone to circular imports (Matt Westcott) * Disable linking to root page in rich text, making the page non-functional (Matt Westcott) * Pages should be editable and save-able even if there are broken page or document links in rich text (Matt Westcott) * Avoid redundant round-trips of JSON StreamField data on save, improving performance and preventing consistency issues on fixture loading (Andy Chosak, Matt Westcott) * Users are not logged out when changing their own password through the Users area (Matt Westcott) ## Upgrade considerations ### `wagtail.admin.forms` reorganized The `wagtail.admin.forms` module has been split up into submodules to make it less prone to producing circular imports, particularly when a custom user model is in use. The following (undocumented) definitions have now been moved to new locations: | Definition | New location | |----------------------------------------------|---------------------------------------| | LoginForm | wagtail.admin.forms.auth | | PasswordResetForm | wagtail.admin.forms.auth | | URLOrAbsolutePathValidator | wagtail.admin.forms.choosers | | URLOrAbsolutePathField | wagtail.admin.forms.choosers | | ExternalLinkChooserForm | wagtail.admin.forms.choosers | | EmailLinkChooserForm | wagtail.admin.forms.choosers | | CollectionViewRestrictionForm | wagtail.admin.forms.collections | | CollectionForm | wagtail.admin.forms.collections | | BaseCollectionMemberForm | wagtail.admin.forms.collections | | BaseGroupCollectionMemberPermissionFormSet | wagtail.admin.forms.collections | | collection_member_permission_formset_factory | wagtail.admin.forms.collections | | CopyForm | wagtail.admin.forms.pages | | PageViewRestrictionForm | wagtail.admin.forms.pages | | SearchForm | wagtail.admin.forms.search | | BaseViewRestrictionForm | wagtail.admin.forms.view_restrictions | The following definitions remain in `wagtail.admin.forms`: `FORM_FIELD_OVERRIDES`, `DIRECT_FORM_FIELD_OVERRIDES`, `formfield_for_dbfield`, `WagtailAdminModelFormMetaclass`, `WagtailAdminModelForm` and `WagtailAdminPageForm`. # 2.4.html.md # Wagtail 2.4 release notes *December 19, 2018* > * [What’s new](#what-s-new) > * [Upgrade considerations](#upgrade-considerations) ## What’s new ### New “Welcome to your Wagtail site” Starter Page When using the `wagtail start` command to make a new site, users will now be greeted with a proper starter page. Thanks to Timothy Allen and Scott Cranfill for pulling this off! > ![Wagtail welcome message](_static/images/tutorial/tutorial_1.png) ### Other features * Added support for Python 3.7 (Matt Westcott) * Added `max_count` option on page models to limit the number of pages of a particular type that can be created (Dan Braghis) * Document and image choosers now show the document / image’s collection (Alejandro Garza, Janneke Janssen) * New `image_url` template tag allows to generate dynamic image URLs, so image renditions are being created outside the main request which improves performance. Requires extra configuration, see [Dynamic image serve view](../advanced_topics/images/image_serve_view.md) (Yannick Chabbert, Dan Braghis). * Added ability to run individual tests through tox (Benjamin Bach) * Collection listings are now ordered by name (Seb Brown) * Added `file_hash` field to documents (Karl Hobley, Dan Braghis) * Added last login to the user overview (Noah B Johnson) * Changed design of image editing page (Janneke Janssen, Ben Enright) * Added Slovak character map for JavaScript slug generation (Andy Chosak) * Make documentation links on welcome page work for prereleases (Matt Westcott) * Allow overridden `copy()` methods in `Page` subclasses to be called from the page copy view (Robert Rollins) * Users without a preferred language set on their profile now use language selected by Django’s `LocaleMiddleware` (Benjamin Bach) * Added hooks to customize the actions menu on the page create/edit views (Matt Westcott) * Cleanup: Use `functools.partial()` instead of `django.utils.functional.curry()` (Sergey Fedoseev) * Added `before_move_page` and `after_move_page` hooks (Maylon Pedroso) * Bulk deletion button for snippets is now hidden until items are selected (Karl Hobley) ### Bug fixes * Query objects returned from `PageQuerySet.type_q` can now be merged with `|` (Brady Moe) * Add `rel="noopener noreferrer"` to target blank links (Anselm Bradford) * Additional fields on custom document models now show on the multiple document upload view (Robert Rollins, Sergey Fedoseev) * Help text does not overflow when using a combination of BooleanField and FieldPanel in page model (Dzianis Sheka) * Document chooser now displays more useful help message when there are no documents in Wagtail document library (gmmoraes, Stas Rudakou) * Allow custom logos of any height in the admin menu (Meteor0id) * Allow nav menu to take up all available space instead of scrolling (Meteor0id) * Users without the edit permission no longer see “Edit” links in list of pages waiting for moderation (Justin Focus, Fedor Selitsky) * Redirects now return 404 when destination is unspecified or a page with no site (Hillary Jeffrey) * Refactor all breakpoint definitions, removing style overlaps (Janneke Janssen) * Updated draftjs_exporter to 2.1.5 to fix bug in handling adjacent entities (Thibaud Colas) * Page titles consisting only of stopwords now generate a non-empty default slug (Andy Chosak, Janneke Janssen) * Sitemap generator now allows passing a sitemap instance in the URL configuration (Mitchel Cabuloy, Dan Braghis) ## Upgrade considerations ### Removed support for Django 1.11 Django 1.11 is no longer supported in this release; please upgrade your project to Django 2.0 or 2.1 before upgrading to Wagtail 2.4. ### Custom image model migrations created on Wagtail <1.8 may fail Projects with a custom image model (see [Custom image models](../advanced_topics/images/custom_image_model.md#custom-image-model)) created on Wagtail 1.7 or earlier are likely to have one or more migrations that refer to the (now-deleted) `wagtailimages.Filter` model. In Wagtail 2.4, the migrations that defined this model have been squashed, which may result in the error `ValueError: Related model 'wagtailimages.Filter' cannot be resolved` when bringing up a new instance of the database. To rectify this, check your project’s migrations for `ForeignKey` references to `wagtailimages.Filter`, and change them to `IntegerField` definitions. For example, the line: ```python ('filter', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='+', to='wagtailimages.Filter')), ``` should become: ```python ('filter', models.IntegerField(blank=True, null=True)), ``` # 2.5.1.html.md # Wagtail 2.5.1 release notes *May 7, 2019* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes * Prevent crash when comparing StructBlocks in revision history (Adrian Turjak, Matt Westcott) # 2.5.2.html.md # Wagtail 2.5.2 release notes *August 1, 2019* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes * Delay dirty form check to prevent “unsaved changes” warning from being wrongly triggered (Thibaud Colas) # 2.5.html.md # Wagtail 2.5 release notes *April 24, 2019* > * [What’s new](#what-s-new) > * [Upgrade considerations](#upgrade-considerations) ## What’s new ### Django 2.2 support This release is compatible with Django 2.2. Compatibility fixes were contributed by Matt Westcott and Andy Babic. ### New Markdown shortcuts in rich text Wagtail’s rich text editor now supports using Markdown shortcuts for inline formatting: * `**` for bold * `_` for italic * `~` for strikethrough (if enabled) * ``` for code (if enabled) To learn other shortcuts, have a look at the [keyboard shortcuts](https://www.draftail.org/docs/keyboard-shortcuts) reference. ### Other features * Added support for customizing EditHandler-based forms on a per-request basis (Bertrand Bordage) * Added more informative error message when `|richtext` filter is applied to a non-string value (mukesh5) * Automatic search indexing can now be disabled on a per-model basis via the `search_auto_update` attribute (Karl Hobley) * Improved diffing of StreamFields when comparing page revisions (Karl Hobley) * Highlight broken links to pages and missing documents in rich text (Brady Moe) * Preserve links when copy-pasting rich text content from Wagtail to other tools (Thibaud Colas) * Rich text to contentstate conversion now prioritizes more specific rules, to accommodate `

` and `
` elements with attributes (Matt Westcott) * Added limit image upload size by number of pixels (Thomas Elliott) * Added `manage.py wagtail_update_index` alias to avoid clashes with `update_index` commands from other packages (Matt Westcott) * Renamed `target_model` argument on `PageChooserBlock` to `page_type` (Loic Teixeira) * `edit_handler` and `panels` can now be defined on a `ModelAdmin` definition (Thomas Kremmel) * Add Learn Wagtail to third-party tutorials in documentation (Matt Westcott) * Add a Django setting `TAG_LIMIT` to limit number of tags that can be added to any taggit model (Mani) * Added instructions on how to generate urls for `ModelAdmin` to documentation (LB (Ben Johnston), Andy Babic) * Added option to specify a fallback URL on `{% pageurl %}` (Arthur Holzner) * Add support for more rich text formats, disabled by default: `blockquote`, `superscript`, `subscript`, `strikethrough`, `code` (Md Arifin Ibne Matin) * Added `max_count_per_parent` option on page models to limit the number of pages of a given type that can be created under one parent page (Wesley van Lee) * `StreamField` field blocks now accept a `validators` argument (Tom Usher) * Added edit / delete buttons to snippet index and “don’t delete” option to confirmation screen, for consistency with pages (Kevin Howbrook) * Added name attributes to all built-in page action menu items (LB (Ben Johnston)) * Added validation on the filter string to the Jinja2 image template tag (Jonny Scholes) * Changed the pages reordering UI toggle to make it easier to find (Katie Locke, Thibaud Colas) * Added support for rich text link rewrite handlers for `external` and `email` links (Md Arifin Ibne Matin) * Clarify installation instructions in documentation, especially regarding virtual environments. (Naomi Morduch Toubman) ### Bug fixes * Set `SERVER_PORT` to 443 in `Page.dummy_request()` for HTTPS sites (Sergey Fedoseev) * Include port number in `Host` header of `Page.dummy_request()` (Sergey Fedoseev) * Validation error messages in `InlinePanel` no longer count towards `max_num` when disabling the ‘add’ button (Todd Dembrey, Thibaud Colas) * Rich text to contentstate conversion now ignores stray closing tags (frmdstryr) * Escape backslashes in `postgres_search` queries (Hammy Goonan) * Parent page link in page chooser search results no longer navigates away (Asanka Lihiniyagoda, Sævar Öfjörð Magnússon) * `routablepageurl` tag now correctly omits domain part when multiple sites exist at the same root (Gassan Gousseinov) * Added missing collection column specifier on document listing template (Sergey Fedoseev) * Page Copy will now also copy ParentalManyToMany field relations (LB (Ben Johnston)) * Admin HTML header now includes correct language code (Matt Westcott) * Unclear error message when saving image after focal point edit (Hugo van den Berg) * Increase max length on `Embed.thumbnail_url` to 255 characters (Kevin Howbrook) * `send_mail` now correctly uses the `html_message` kwarg for HTML messages (Tiago Requeijo) * Page copying no longer allowed if page model has reached its `max_count` (Andy Babic) * Don’t show page type on page chooser button when multiple types are allowed (Thijs Kramer) * Make sure page chooser search results correspond to the latest search by canceling previous requests (Esper Kuijs) * Inform user when moving a page from one parent to another where there is an already existing page with the same slug (Casper Timmers) * User add/edit forms now support form widgets with JS/CSS media (Damian Grinwis) * Rich text processing now preserves non-breaking spaces instead of converting them to normal spaces (Wesley van Lee) * Prevent autocomplete dropdowns from appearing over date choosers on Chrome (Kevin Howbrook) * Prevent crash when logging HTTP errors on Cloudflare cache purging (Kevin Howbrook) * Prevent rich text editor crash when filtering copy-pasted content and the last block is to be removed, e.g. unsupported image (Thibaud Colas) * Removing rich text links / documents now also works when the text selection is backwards (Thibaud Colas) * Prevent the rich text editor from crashing when copy-paste filtering removes all of its content (Thibaud Colas) * Page chooser now respects custom `get_admin_display_title` methods on parent page and breadcrumb (Haydn Greatnews) * Added consistent whitespace around sortable table headings (Matt Westcott) * Moved locale names for Chinese (Simplified) and Chinese (Traditional) to `zh_Hans` and `zh_Hant` (Matt Westcott) ## Upgrade considerations ### `EditHandler.bind_to_model` and `EditHandler.bind_to_instance` deprecated The internal `EditHandler` methods `bind_to_model` and `bind_to_instance` have been deprecated, in favor of a new combined `bind_to` method which accepts `model`, `instance`, `request` and `form` as optional keyword arguments. Any user code which calls `EditHandler.bind_to_model(model)` should be updated to use `EditHandler.bind_to(model=model)` instead; any user code which calls `EditHandler.bind_to_instance(instance, request, form)` should be updated to use `EditHandler.bind_to(instance=instance, request=request, form=form)`. ### Changes to admin pagination helpers Several changes have been made to pagination handling within the Wagtail admin; these are internal API changes, but may affect applications and third-party packages that add new paginated object listings, including chooser modals, to the admin. The `paginate` function in `wagtail.utils.pagination` has been deprecated in favor of the `django.core.paginator.Paginator.get_page` method introduced in Django 2.0 - a call such as: ```python from wagtail.utils.pagination import paginate paginator, page = paginate(request, object_list, per_page=25) ``` should be replaced with: ```python from django.core.paginator import Paginator paginator = Paginator(object_list, per_page=25) page = paginator.get_page(request.GET.get('p')) ``` Additionally, the `is_ajax` flag on the template `wagtailadmin/shared/pagination_nav.html` has been deprecated in favour of a new template `wagtailadmin/shared/ajax_pagination_nav.html`: ```html+django {% include "wagtailadmin/shared/pagination_nav.html" with items=page_obj is_ajax=1 %} ``` should become: ```html+django {% include "wagtailadmin/shared/ajax_pagination_nav.html" with items=page_obj %} ``` ### New rich text formats Wagtail now has built-in support for new rich text formats, disabled by default: * `blockquote`, using the `blockquote` Draft.js block type, saved as a `

` tag. * `superscript`, using the `SUPERSCRIPT` Draft.js inline style, saved as a `` tag. * `subscript`, using the `SUBSCRIPT` Draft.js inline style, saved as a `` tag. * `strikethrough`, using the `STRIKETHROUGH` Draft.js inline style, saved as a `` tag. * `code`, using the `CODE` Draft.js inline style, saved as a `` tag. Projects already using those exact Draft.js type and HTML tag combinations can safely replace their feature definitions with the new built-ins. Projects that use the same feature identifier can keep their existing feature definitions as overrides. Finally, if the Draft.js types / HTML tags are used but with a different combination, do not enable the new feature definitions to avoid conflicts in storage or editor behavior. ### `register_link_type` and `register_embed_type` methods for rich text tag rewriting have changed The `FeatureRegistry.register_link_type` and `FeatureRegistry.register_embed_type` methods, which define how links and embedded media in rich text are converted to HTML, now accept a handler class. Previously, they were passed an identifier string and a rewrite function. For details of updating your code to the new convention, see [Rewrite handlers](../extending/rich_text_internals.md#rich-text-rewrite-handlers). ### Chinese language locales changed to `zh_Hans` and `zh_Hant` The translations for Chinese (Simplified) and Chinese (Traditional) are now available under the locale names `zh_Hans` and `zh_Hant` respectively, rather than `zh_CN` and `zh_TW`. Projects that currently use the old names for the `LANGUAGE_CODE` setting may need to update the settings file to use the new names. # 2.6.1.html.md # Wagtail 2.6.1 release notes *August 5, 2019* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes * Prevent JavaScript errors caused by unescaped quote characters in translation strings (Matt Westcott) # 2.6.2.html.md # Wagtail 2.6.2 release notes *September 19, 2019* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes * Prevent search indexing failures on Postgres 9.4 and Django >= 2.2.1 (Matt Westcott) # 2.6.3.html.md # Wagtail 2.6.3 release notes *October 22, 2019* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes * Altering Django REST Framework’s `DEFAULT_AUTHENTICATION_CLASSES` setting no longer breaks the page explorer menu and admin API (Matt Westcott) # 2.6.html.md # Wagtail 2.6 release notes *August 1, 2019* > * [What’s new](#what-s-new) > * [Upgrade considerations](#upgrade-considerations) ## What’s new ### Accessibility targets and improvements Wagtail now has official accessibility support targets: we are aiming for compliance with [WCAG2.1](https://www.w3.org/TR/WCAG21/), AA level. WCAG 2.1 is the international standard that underpins many national accessibility laws. Wagtail isn’t fully compliant just yet, but we have made many changes to the admin interface to get there. We thank the UK Government (in particular the CMS team at the Department for International Trade), who commissioned many of these improvements. Here are changes that should make Wagtail more usable for all users regardless of abilities: * Increase font-size across the whole admin (Beth Menzies, Katie Locke) * Improved text color contrast across the whole admin (Beth Menzies, Katie Locke) * Added consistent focus outline styles across the whole admin (Thibaud Colas) * Ensured the ‘add child page’ button displays when focused (Helen Chapman, Katie Locke) This release also contains many big improvements for screen reader users: * Added more ARIA landmarks across the admin interface and welcome page for screen reader users to navigate the CMS more easily (Beth Menzies) * Improved heading structure for screen reader users navigating the CMS admin (Beth Menzies, Helen Chapman) * Make icon font implementation more screen-reader-friendly (Thibaud Colas) * Removed buggy tab order customizations in the CMS admin (Jordan Bauer) * Screen readers now treat page-level action dropdowns as navigation instead of menus (Helen Chapman) * Fixed occurrences of invalid HTML across the CMS admin (Thibaud Colas) * Add empty alt attributes to all images in the CMS admin (Andreas Bernacca) * Fixed focus not moving to the pages explorer menu when open (Helen Chapman) We’ve also had a look at how controls are labeled across the UI for screen reader users: * Add image dimensions in image gallery and image choosers for screen reader users (Helen Chapman) * Add more contextual information for screen readers in the explorer menu’s links (Helen Chapman) * Make URL generator preview image alt translatable (Thibaud Colas) * Screen readers now announce “Dashboard” for the main nav’s logo link instead of Wagtail’s version number (Thibaud Colas) * Remove duplicate labels in image gallery and image choosers for screen reader users (Helen Chapman) * Added a label to the modals’ “close” button for screen reader users (Helen Chapman, Katie Locke) * Added labels to permission checkboxes for screen reader users (Helen Chapman, Katie Locke) * Improve screen-reader labels for action links in page listing (Helen Chapman, Katie Locke) * Add screen-reader labels for table headings in page listing (Helen Chapman, Katie Locke) * Add screen reader labels for page privacy toggle, edit lock, status tag in page explorer & edit views (Helen Chapman, Katie Locke) * Add screen-reader labels for dashboard summary cards (Helen Chapman, Katie Locke) * Add screen-reader labels for privacy toggle of collections (Helen Chapman, Katie Locke) Again, this is still a work in progress – if you are aware of other existing accessibility issues, please do [open an issue](https://github.com/wagtail/wagtail/issues?q=is%3Aopen+is%3Aissue+label%3AAccessibility) if there isn’t one already. ### Other features * Added support for `short_description` for field labels in modeladmin’s `InspectView` (Wesley van Lee) * Rearranged SCSS folder structure to the client folder and split them approximately according to ITCSS. (Naomi Morduch Toubman, Jonny Scholes, Janneke Janssen, Hugo van den Berg) * Added support for specifying cell alignment on TableBlock (Samuel Mendes) * Added more informative error when a non-image object is passed to the `image` template tag (Deniz Dogan) * Added ButtonHelper examples in the modelAdmin primer page within documentation (Kalob Taulien) * Multiple clarifications, grammar, and typo fixes throughout documentation (Dan Swain) * Use correct URL in API example in documentation (Michael Bunsen) * Move datetime widget initializer JS into the widget’s form media instead of page editor media (Matt Westcott) * Add form field prefixes for input forms in chooser modals (Matt Westcott) * Removed version number from the logo link’s title. The version can now be found under the Settings menu (Thibaud Colas) * Added “don’t delete” option to confirmation screen when deleting images, documents and modeladmin models (Kevin Howbrook) * Added `branding_title` template block for the admin title prefix (Dillen Meijboom) * Added support for custom search handler classes to modeladmin’s IndexView, and added a class that uses the default Wagtail search backend for searching (Seb Brown, Andy Babic) * Update group edit view to expose the `Permission` object for each checkbox (George Hickman) * Improve performance of Pages for Moderation panel (Fidel Ramos) * Added `process_child_object` and `exclude_fields` arguments to `Page.copy()` to make it easier for third-party apps to customize copy behavior (Karl Hobley) * Added `Page.with_content_json()`, allowing revision content loading behavior to be customized on a per-model basis (Karl Hobley) * Added `construct_settings_menu` hook (Jordan Bauer, Quadric) * Fixed compatibility of date / time choosers with wagtail-react-streamfield (Mike Hearn) * Performance optimization of several admin functions, including breadcrumbs, home and index pages (Fidel Ramos) ### Bug fixes * ModelAdmin no longer fails when filtering over a foreign key relation (Jason Dilworth, Matt Westcott) * The Wagtail version number is now visible within the Settings menu (Kevin Howbrook) * Scaling images now rounds values to an integer so that images render without errors (Adrian Brunyate) * Revised test decorator to ensure TestPageEditHandlers test cases run correctly (Alex Tomkins) * Wagtail bird animation in admin now ends correctly on all browsers (Deniz Dogan) * Explorer menu no longer shows sibling pages for which the user does not have access (Mike Hearn) * Admin HTML now includes the correct `dir` attribute for the active language (Andreas Bernacca) * Fix type error when using `--chunk_size` argument on `./manage.py update_index` (Seb Brown) * Avoid rendering entire form in EditHandler’s `repr` method (Alex Tomkins) * Add empty alt attributes to HTML output of Embedly and oEmbed embed finders (Andreas Bernacca) * Clear pending AJAX request if error occurs on page chooser (Matt Westcott) * Prevent text from overlapping in focal point editing UI (Beth Menzies) * Restore custom “Date” icon for scheduled publishing panel in Edit page’s Settings tab (Helen Chapman) * Added missing form media to user edit form template (Matt Westcott) * `Page.copy()` no longer copies child objects when the accessor name is included in `exclude_fields_in_copy` (Karl Hobley) * Clicking the privacy toggle while the page is still loading no longer loads the wrong data in the page (Helen Chapman) * Added missing `is_stored_locally` method to `AbstractDocument` (jonny5532) * Query model no longer removes punctuation as part of string normalization (William Blackie) * Make login test helper work with user models with non-default username fields (Andrew Miller) * Delay dirty form check to prevent “unsaved changes” warning from being wrongly triggered (Thibaud Colas) ## Upgrade considerations ### Removed support for Python 3.4 Python 3.4 is no longer supported as of this release; please upgrade to Python 3.5 or above before upgrading Wagtail. ### Icon font implementation changes The icon font implementation has been changed to be invisible for screen-reader users, by switching to using [Private Use Areas](https://en.wikipedia.org/wiki/Private_Use_Areas) Unicode code points. All of the icon classes (`icon-user`, `icon-search`, etc) should still work the same, except for two which have been removed because they were duplicates: * `icon-picture` is removed. Use `icon-image` instead (same visual). * `icon-file-text-alt` is removed. Use `icon-doc-full` instead (same visual). For a list of all available icons, please see the [UI Styleguide](../contributing/ui_guidelines.md#styleguide). # 2.7.1.html.md # Wagtail 2.7.1 release notes *January 8, 2020* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes * Management command startup checks under `ManifestStaticFilesStorage` no longer fail if `collectstatic` has not been run first (Alex Tomkins) # 2.7.2.html.md # Wagtail 2.7.2 release notes *April 14, 2020* ## CVE-2020-11001: Possible XSS attack via page revision comparison view This release addresses a cross-site scripting (XSS) vulnerability on the page revision comparison view within the Wagtail admin interface. A user with a limited-permission editor account for the Wagtail admin could potentially craft a page revision history 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. Many thanks to Vlad Gerasimenko for reporting this issue. # 2.7.3.html.md # Wagtail 2.7.3 release notes *May 4, 2020* ## CVE-2020-11037: Potential timing attack on password-protected private pages This release addresses a potential timing attack on pages or documents that have been protected with a shared password through Wagtail’s “Privacy” controls. This password check is performed through a character-by-character string comparison, and so an attacker who is able to measure the time taken by this check to a high degree of accuracy could potentially use timing differences to gain knowledge of the password. (This is [understood to be feasible on a local network, but not on the public internet](https://groups.google.com/d/msg/django-developers/iAaq0pvHXuA/fpUuwjK3i2wJ).) Many thanks to Thibaud Colas for reporting this issue. # 2.7.4.html.md # Wagtail 2.7.4 release notes *July 20, 2020* ## CVE-2020-15118: HTML injection through form field help text This release addresses an HTML injection vulnerability through help text in the `wagtail.contrib.forms` form builder app. When a form page type is made available to Wagtail editors, and the page template is built using Django’s standard form rendering helpers such as `form.as_p` [(as directed in the documentation)](../reference/contrib/forms/index.md#form-builder-usage), any HTML tags used within a form field’s help text will be rendered unescaped in the page. Allowing HTML within help text is an intentional design decision by Django (see the docs for [`help_text`](https://docs.djangoproject.com/en/stable/ref/models/fields/#django.db.models.Field.help_text)); however, as a matter of policy Wagtail does not allow editors to insert arbitrary HTML by default, as this could potentially be used to carry out cross-site scripting attacks, including privilege escalation. This functionality should therefore not have been made available to editor-level users. The vulnerability is not exploitable by an ordinary site visitor without access to the Wagtail admin. Site owners who wish to re-enable the use of HTML within help text (and are willing to accept the risk of this being exploited by editors) may set `WAGTAILFORMS_HELP_TEXT_ALLOW_HTML = True` in their configuration settings. Many thanks to Timothy Bautista for reporting this issue. ## Additional fixes * Expand Pillow dependency range to include 7.x (Harris Lapiroff, Matt Westcott) # 2.7.html.md # Wagtail 2.7 (LTS) release notes *November 6, 2019* > * [What’s new](#what-s-new) > * [Upgrade considerations](#upgrade-considerations) Wagtail 2.7 is designated a Long Term Support (LTS) release. Long Term Support releases will continue to receive maintenance updates as necessary to address security and data-loss related issues, up until the next LTS release (typically a period of 12 months). ## What’s new ### Improved StreamField design ![image](_static/images/releasenotes_2_7_streamfield_styles.png) The design of the StreamField user interface has been updated to improve clarity and usability, including better handling of nested blocks. This work was completed by Bertrand Bordage as part of the [Wagtail’s First Hatch](https://www.kickstarter.com/projects/noripyt/wagtails-first-hatch) crowdfunding campaign. We would like to thank all [supporters of the campaign](https://wagtail.org/blog/wagtails-first-hatch-backers/). ### WebP image support Images can now be uploaded and rendered in [WebP](https://developers.google.com/speed/webp) format; see [Image file formats](../advanced_topics/images/image_file_formats.md#image-file-formats) for details. This feature was developed by frmdstryr, Karl Hobley and Matt Westcott. ### Other features * Added Elasticsearch 7 support (pySilver) * Added Python 3.8 support (John Carter, Matt Westcott) * Added `construct_page_listing_buttons` hook (Michael van Tellingen) * Added more detailed documentation and troubleshooting for installing OpenCV for feature detection (Daniele Procida) * Move and refactor upgrade notification JS (Jonny Scholes) * Remove need for Elasticsearch `update_all_types` workaround, upgrade minimum release to 6.4.0 or above (Jonathan Liuti) * Add ability to insert internal anchor links/links with fragment identifiers in Draftail (rich text) fields (Iman Syed) * Added Table Block caption for accessibility (Rahmi Pruitt) * Add ability for users to change their own name via the account settings page (Kevin Howbrook) * Add ability to insert telephone numbers as links in Draftail (rich text) fields (Mikael Engström and Liam Brenner) * Increase delay before search in the snippet chooser, to prevent redundant search request round trips (Robert Rollins) * Add `WAGTAIL_EMAIL_MANAGEMENT_ENABLED` setting to determine whether users can change their email address (Janne Alatalo) * Recognise Soundcloud artist URLs as embeddable (Kiril Staikov) * Add `WAGTAILDOCS_SERVE_METHOD` setting to determine how document downloads will be linked to and served (Tobias McNulty, Matt Westcott) * Add `WAGTAIL_MODERATION_ENABLED` setting to enable / disable the ‘Submit for Moderation’ option (Jacob Topp-Mugglestone) - thanks to [The Motley Fool](https://www.fool.com/) for sponsoring this feature * Added settings to customize pagination page size for the Images admin area (Brian Whitton) * Added ARIA role to TableBlock output (Matt Westcott) * Added cache-busting query parameters to static files within the Wagtail admin (Matt Westcott) * Allow `register_page_action_menu_item` and `construct_page_action_menu` hooks to override the default menu action (Rahmi Pruitt, Matt Westcott) - thanks to [The Motley Fool](https://www.fool.com/) for sponsoring review of this feature * `WAGTAILIMAGES_MAX_IMAGE_PIXELS` limit now takes the number of animation frames into account (Karl Hobley) ### Bug fixes * Added line breaks to long filenames on multiple image / document uploader (Kevin Howbrook) * Added https support for Scribd oEmbed provider (Rodrigo) * Changed StreamField group label color so labels are visible (Catherine Farman) * Prevented images with a very wide aspect ratio from being displayed distorted in the rich text editor (Iman Syed) * Prevent exception when deleting a model with a protected One-to-one relationship (Neal Todd) * Added labels to snippet bulk edit checkboxes for screen reader users (Martey Dodoo) * Middleware responses during page preview are now properly returned to the user (Matt Westcott) * Default text of page links in rich text uses the public page title rather than the admin display title (Andy Chosak) * Specific page permission checks are now enforced when viewing a page revision (Andy Chosak) * `pageurl` and `slugurl` tags no longer fail when `request.site` is `None` (Samir Shah) * Output form media on add/edit image forms with custom models (Matt Westcott) * Output form media on add/edit document forms with custom models (Sergey Fedoseev) * Fixes layout for the clear checkbox in default FileField widget (Mikalai Radchuk) * Remove ASCII conversion from Postgres search backend, to support stemming in non-Latin alphabets (Pavel Denisov) * Prevent tab labels on page edit view from being cut off on very narrow screens (Kevin Howbrook) * Very long words in page listings are now broken where necessary (Kevin Howbrook) * Language chosen in user preferences no longer persists on subsequent requests (Bojan Mihelac) * Prevent new block IDs from being assigned on repeated calls to `StreamBlock.get_prep_value` (Colin Klein) * Prevent broken images in notification emails when static files are hosted on a remote domain (Eduard Luca) * Replace styleguide example avatar with default image to avoid issues when custom user model is used (Matt Westcott) * `DraftailRichTextArea` is no longer treated as a hidden field by Django’s form logic (Sergey Fedoseev) * Replace format() placeholders in translatable strings with % formatting (Matt Westcott) * Altering Django REST Framework’s `DEFAULT_AUTHENTICATION_CLASSES` setting no longer breaks the page explorer menu and admin API (Matt Westcott) * Regression - missing label for external link URL field in link chooser (Stefani Castellanos) ## Upgrade considerations ### Query strings added to static file URLs within the admin To avoid problems caused by outdated cached JavaScript / CSS files following a Wagtail upgrade, URLs to static files within the Wagtail admin now include a version-specific query parameter of the form `?v=1a2b3c4d`. Under certain front-end cache configurations (such as [Cloudflare’s ‘No Query String’ caching level](https://support.cloudflare.com/hc/en-us/articles/200168256-What-are-Cloudflare-s-caching-levels-)), the presence of this parameter may prevent the file from being cached at all. If you are using such a setup, and have some other method in place to expire outdated files (e.g. clearing the cache on deployment), you can disable the query parameter by setting `WAGTAILADMIN_STATIC_FILE_VERSION_STRINGS` to False in your project settings. (Note that this is automatically disabled when `ManifestStaticFilesStorage` is in use.) ### `Page.dummy_request` is deprecated The internal `Page.dummy_request` method (which generates an HTTP request object simulating a real page request, for use in previews) has been deprecated, as it did not correctly handle errors generated during middleware processing. Any code that calls this method to render page previews should be updated to use the new method `Page.make_preview_request(original_request=None, preview_mode=None)`, which builds the request and calls `Page.serve_preview` as a single operation. ### Changes to document serving on remote storage backends (Amazon S3 etc) This release introduces a new setting [WAGTAILDOCS_SERVE_METHOD](../reference/settings.md#wagtaildocs-serve-method) to control how document downloads are served. On previous versions of Wagtail, document files would always be served through a Django view, to allow permission checks to be applied. When using a remote storage backend such as Amazon S3, this meant that the document would be downloaded to the Django server on every download request. In Wagtail 2.7, the default behavior on remote storage backends is to redirect to the storage’s underlying URL after performing the permission check. If this is unsuitable for your project (for example, your storage provider is configured to block public access, or revealing its URL would be a security risk) you can revert to the previous behavior by setting `WAGTAILDOCS_SERVE_METHOD` to `'serve_view'`. ### Template change for page action menu hooks When customizing the action menu on the page edit view through the [register_page_action_menu_item](../reference/hooks.md#register-page-action-menu-item) or [construct_page_action_menu](../reference/hooks.md#construct-page-action-menu) hook, the `ActionMenuItem` object’s `template` attribute or `render_html` method can be overridden to customize the menu item’s HTML. As of Wagtail 2.7, the HTML returned from these should *not* include the enclosing `
  • ` element. Any add-on library that uses this feature and needs to preserve backward compatibility with previous Wagtail versions can conditionally reinsert the `
  • ` wrapper through its `render_html` method - for example: > ```python > from django.utils.html import format_html > from wagtail import VERSION as WAGTAIL_VERSION > from wagtail.admin.action_menu import ActionMenuItem > class CustomMenuItem(ActionMenuItem): > template = 'myapp/my_menu_item.html' > def render_html(self, request, parent_context): > html = super().render_html(request, parent_context) > if WAGTAIL_VERSION < (2, 7): > html = format_html('
  • {}
  • ', html) > return html > ``` ### `wagtail.admin.utils` and `wagtail.admin.decorators` modules deprecated The modules `wagtail.admin.utils` and `wagtail.admin.decorators` have been deprecated. The helper functions defined here exist primarily for Wagtail’s internal use; however, some of them (particularly `send_mail` and `permission_required`) may be found in user code, and import lines will need to be updated. The new locations for these definitions are as follows: | Definition | Old location | New location | |---------------------------------|--------------------------|----------------------------| | any_permission_required | wagtail.admin.utils | wagtail.admin.auth | | permission_denied | wagtail.admin.utils | wagtail.admin.auth | | permission_required | wagtail.admin.utils | wagtail.admin.auth | | PermissionPolicyChecker | wagtail.admin.utils | wagtail.admin.auth | | user_has_any_page_permission | wagtail.admin.utils | wagtail.admin.auth | | user_passes_test | wagtail.admin.utils | wagtail.admin.auth | | users_with_page_permission | wagtail.admin.utils | wagtail.admin.auth | | reject_request | wagtail.admin.decorators | wagtail.admin.auth | | require_admin_access | wagtail.admin.decorators | wagtail.admin.auth | | get_available_admin_languages | wagtail.admin.utils | wagtail.admin.localization | | get_available_admin_time_zones | wagtail.admin.utils | wagtail.admin.localization | | get_js_translation_strings | wagtail.admin.utils | wagtail.admin.localization | | WAGTAILADMIN_PROVIDED_LANGUAGES | wagtail.admin.utils | wagtail.admin.localization | | send_mail | wagtail.admin.utils | wagtail.admin.mail | | send_notification | wagtail.admin.utils | wagtail.admin.mail | | get_object_usage | wagtail.admin.utils | wagtail.admin.models | | popular_tags_for_model | wagtail.admin.utils | wagtail.admin.models | | get_site_for_user | wagtail.admin.utils | wagtail.admin.navigation | # 2.8.1.html.md # Wagtail 2.8.1 release notes *April 14, 2020* ## CVE-2020-11001: Possible XSS attack via page revision comparison view This release addresses a cross-site scripting (XSS) vulnerability on the page revision comparison view within the Wagtail admin interface. A user with a limited-permission editor account for the Wagtail admin could potentially craft a page revision history 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. Many thanks to Vlad Gerasimenko for reporting this issue. # 2.8.2.html.md # Wagtail 2.8.2 release notes *May 4, 2020* ## CVE-2020-11037: Potential timing attack on password-protected private pages This release addresses a potential timing attack on pages or documents that have been protected with a shared password through Wagtail’s “Privacy” controls. This password check is performed through a character-by-character string comparison, and so an attacker who is able to measure the time taken by this check to a high degree of accuracy could potentially use timing differences to gain knowledge of the password. (This is [understood to be feasible on a local network, but not on the public internet](https://groups.google.com/d/msg/django-developers/iAaq0pvHXuA/fpUuwjK3i2wJ).) Many thanks to Thibaud Colas for reporting this issue. # 2.8.html.md # Wagtail 2.8 release notes *February 3, 2020* > * [What’s new](#what-s-new) > * [Upgrade considerations](#upgrade-considerations) ## What’s new ### Django 3.0 support This release is compatible with Django 3.0. Compatibility fixes were contributed by Matt Westcott and Mads Jensen. ### Improved page locking The page locking feature has been revised so that the editor locking a page is given exclusive edit access to it, rather than it becoming read-only to everyone. A new Reports menu allows admin / moderator level users to see the currently locked pages, and unlock them if required. This feature was developed by Karl Hobley and Jacob Topp-Mugglestone. Thanks to [The Motley Fool](https://www.fool.com/) for sponsoring this feature. ### Other features * Removed leftover Python 2.x compatibility code (Sergey Fedoseev) * Combine flake8 configurations (Sergey Fedoseev) * Improve diffing behavior for text fields (Aliosha Padovani) * Improve contrast of disabled inputs (Nick Smith) * Added `get_document_model_string` function (Andrey Smirnov) * Added support for Cloudflare API tokens for frontend cache invalidation (Tom Usher) * Cloudflare frontend cache invalidation requests are now sent in chunks of 30 to fit within API limits (Tom Usher) * Added `ancestors` field to the pages endpoint in admin API (Karl Hobley) * Removed Django admin management of `Page` & `Site` models (Andreas Bernacca) * Cleaned up Django docs URLs in documentation (Pete Andrew) * Add StreamFieldPanel to available panel types in documentation (Dan Swain) * Add `{{ block.super }}` example to ModelAdmin customization in documentation (Dan Swain) * Add ability to filter image index by a tag (Benedikt Willi) * Add partial experimental support for nested InlinePanels (Matt Westcott, Sam Costigan, Andy Chosak, Scott Cranfill) * Added cache control headers when serving documents (Johannes Vogel) * Use `sensitive_post_parameters` on password reset form (Dan Braghis) * Add `WAGTAILEMBEDS_RESPONSIVE_HTML` setting to remove automatic addition of `responsive-object` around embeds (Kalob Taulien) ### Bug fixes * Rename documents listing column ‘uploaded’ to ‘created’ (LB (Ben Johnston)) * Unbundle the l18n library as it was bundled to avoid installation errors which have been resolved (Matt Westcott) * Prevent error when comparing pages that reference a model with a custom primary key (Fidel Ramos) * Moved `get_document_model` location so it can be imported when Models are not yet loaded (Andrey Smirnov) * Use correct HTML escaping of Jinja2 form templates for StructBlocks (Brady Moe) * All templates with wagtailsettings and modeladmin now use `block.super` for `extra_js` & `extra_css` (Timothy Bautista) * Layout issue when using `FieldRowPanel` with a heading (Andreas Bernacca) * `file_size` and `file_hash` now updated when Document file changed (Andreas Bernacca) * Fixed order of URLs in project template so that static / media URLs are not blocked (Nick Smith) * Added `verbose_name_plural` to form submission model (Janneke Janssen) * Prevent `update_index` failures and incorrect front-end rendering on blank `TableBlock` (Carlo Ascani) * Dropdown initialization on the search page after AJAX call (Eric Sherman) * Make sure all modal chooser search results correspond to the latest search by canceling previous requests (Esper Kuijs) ## Upgrade considerations ### Removed support for Django 2.0 Django 2.0 is no longer supported as of this release; please upgrade to Django 2.1 or above before upgrading Wagtail. ### Edit locking behaviour changed The behavior of the page locking feature in the admin interface has been changed. In past versions, the page lock would apply to all users including the user who locked the page. Now, the user who locked the page can still edit it but all other users cannot. Pages that were locked before this release will continue to be locked in the same way as before, so this only applies to newly locked pages. If you would like to restore the previous behavior, you can set the `WAGTAILADMIN_GLOBAL_PAGE_EDIT_LOCK` setting to `True`. ### Responsive HTML for embeds no longer added by default In previous versions of Wagtail, embedded media elements were given a class name of `responsive-object` and an inline `padding-bottom` style to assist in styling them responsively. These are no longer added by default. To restore the previous behavior, add `WAGTAILEMBEDS_RESPONSIVE_HTML = True` to your project settings. ### API endpoint classes have moved For consistency with Django REST Framework, the `PagesAPIEndpoint`, `ImagesAPIEndpoint` and `DocumentsAPIEndpoint` classes have been renamed to `PagesAPIViewSet`, `ImagesAPIViewSet` and `DocumentsAPIViewSet` and moved to the `views` module in their respective packages. Projects using the Wagtail API should update their registration code accordingly. Old code: ```python from wagtail.api.v2.endpoints import PagesAPIEndpoint from wagtail.api.v2.router import WagtailAPIRouter from wagtail.images.api.v2.endpoints import ImagesAPIEndpoint from wagtail.documents.api.v2.endpoints import DocumentsAPIEndpoint api_router = WagtailAPIRouter('wagtailapi') api_router.register_endpoint('pages', PagesAPIEndpoint) api_router.register_endpoint('images', ImagesAPIEndpoint) api_router.register_endpoint('documents', DocumentsAPIEndpoint) ``` New code: ```python from wagtail.api.v2.views import PagesAPIViewSet from wagtail.api.v2.router import WagtailAPIRouter from wagtail.images.api.v2.views import ImagesAPIViewSet from wagtail.documents.api.v2.views import DocumentsAPIViewSet api_router = WagtailAPIRouter('wagtailapi') api_router.register_endpoint('pages', PagesAPIViewSet) api_router.register_endpoint('images', ImagesAPIViewSet) api_router.register_endpoint('documents', DocumentsAPIViewSet) ``` ### `wagtail.documents.models.get_document_model` has moved The `get_document_model` function should now be imported from `wagtail.documents` rather than `wagtail.documents.models`. See [Custom document model](../advanced_topics/documents/custom_document_model.md#custom-document-model). ### Removed `Page` and `Site` models from Django admin The `Page` and `Site` models are no longer editable through the Django admin backend. If required these models can be re-registered within your own project using Django’s [`ModelAdmin`](https://docs.djangoproject.com/en/stable/ref/contrib/admin/#django.contrib.admin.ModelAdmin): ```python # my_app/admin.py from django.contrib import admin from wagtail.core.models import Page, Site admin.site.register(Site) admin.site.register(Page) ``` # 2.9.1.html.md # Wagtail 2.9.1 release notes *June 30, 2020* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes * Fix incorrect method name in SiteMiddleware deprecation warning (LB (Ben Johnston)) * `wagtail.contrib.sitemaps` no longer depends on SiteMiddleware (Matt Westcott) * Purge image renditions cache when renditions are deleted (Pascal Widdershoven, Matt Westcott) # 2.9.2.html.md # Wagtail 2.9.2 release notes *July 3, 2020* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes * Prevent startup failure when `wagtail.contrib.sitemaps` is in `INSTALLED_APPS` (Matt Westcott) # 2.9.3.html.md # Wagtail 2.9.3 release notes *July 20, 2020* ## CVE-2020-15118: HTML injection through form field help text This release addresses an HTML injection vulnerability through help text in the `wagtail.contrib.forms` form builder app. When a form page type is made available to Wagtail editors, and the page template is built using Django’s standard form rendering helpers such as `form.as_p` [(as directed in the documentation)](../reference/contrib/forms/index.md#form-builder-usage), any HTML tags used within a form field’s help text will be rendered unescaped in the page. Allowing HTML within help text is an intentional design decision by Django (see the docs for [`help_text`](https://docs.djangoproject.com/en/stable/ref/models/fields/#django.db.models.Field.help_text)); however, as a matter of policy Wagtail does not allow editors to insert arbitrary HTML by default, as this could potentially be used to carry out cross-site scripting attacks, including privilege escalation. This functionality should therefore not have been made available to editor-level users. The vulnerability is not exploitable by an ordinary site visitor without access to the Wagtail admin. Site owners who wish to re-enable the use of HTML within help text (and are willing to accept the risk of this being exploited by editors) may set `WAGTAILFORMS_HELP_TEXT_ALLOW_HTML = True` in their configuration settings. Many thanks to Timothy Bautista for reporting this issue. # 2.9.html.md # Wagtail 2.9 release notes *May 4, 2020* > * [What’s new](#what-s-new) > * [Upgrade considerations](#upgrade-considerations) ## What’s new ### Report data exports Data from reports, form submissions and ModelAdmin can now be exported to both XLSX and CSV format. For ModelAdmin, this is enabled by specifying a `list_export` attribute on the ModelAdmin class. This feature was developed by Jacob Topp-Mugglestone and sponsored by [The Motley Fool](https://www.fool.com/). ### CVE-2020-11037: Potential timing attack on password-protected private pages This release addresses a potential timing attack on pages or documents that have been protected with a shared password through Wagtail’s “Privacy” controls. This password check is performed through a character-by-character string comparison, and so an attacker who is able to measure the time taken by this check to a high degree of accuracy could potentially use timing differences to gain knowledge of the password. (This is [understood to be feasible on a local network, but not on the public internet](https://groups.google.com/d/msg/django-developers/iAaq0pvHXuA/fpUuwjK3i2wJ).) Many thanks to Thibaud Colas for reporting this issue. ### Other features * Added support for creating custom reports (Jacob Topp-Mugglestone) * Skip page validation when unpublishing a page (Samir Shah) * Added [MultipleChoiceBlock](../reference/streamfield/blocks.md#streamfield-multiplechoiceblock) block type for StreamField (James O’Toole) * ChoiceBlock now accepts a `widget` keyword argument (James O’Toole) * Reduced contrast of rich text toolbar (Jack Paine) * Support the rel attribute on custom ModelAdmin buttons (Andy Chosak) * Server-side page slug generation now respects `WAGTAIL_ALLOW_UNICODE_SLUGS` (Arkadiusz Michał Ryś) * Wagtail admin no longer depends on SiteMiddleware, avoiding incompatibility with Django sites framework and redundant database queries (aritas1, timmysmalls, Matt Westcott) * Tag field autocompletion now handles custom tag models (Matt Westcott) * `wagtail_serve` URL route can now be omitted for headless sites (Storm Heg) * Allow free tagging to be disabled on custom tag models (Matt Westcott) * Allow disabling page preview by setting `preview_modes` to an empty list (Casper Timmers) * Add Vidyard to oEmbed provider list (Steve Lyall) * Optimise compiling media definitions for complex StreamBlocks (pimarc) * FieldPanel now accepts a ‘heading’ argument (Jacob Topp-Mugglestone) * Replaced deprecated `ugettext` / `ungettext` calls with `gettext` / `ngettext` (Mohamed Feddad) * ListBlocks now call child block `bulk_to_python` if defined (Andy Chosak) * Site settings are now identifiable/cacheable by request as well as site (Andy Babic) * Added `select_related` attribute to site settings to enable more efficient fetching of foreign key values (Andy Babic) * Add caching of image renditions (Tom Dyson, Tim Kamanin) * Add documentation for reporting security issues and internationalisation (Matt Westcott) * Fields on a custom image model can now be defined as required `blank=False` (Matt Westcott) ### Bug fixes * Added ARIA alert role to live search forms in the admin (Casper Timmers) * Reordered login form elements to match expected tab order (Kjartan Sverrisson) * Re-added ‘Close Explorer’ button on mobile viewports (Sævar Öfjörð Magnússon) * Added a more descriptive label to Password reset link for screen reader users (Casper Timmers, Martin Coote) * Improved Wagtail logo contrast by adding a background (Brian Edelman, Simon Evans, Ben Enright) * Prevent duplicate notification messages on page locking (Jacob Topp-Mugglestone) * Rendering of non field errors for InlinePanel items (Storm Heg) * `{% image ... as var %}` now clears the context variable when passed None as an image (Maylon Pedroso) * `refresh_index` method on Elasticsearch no longer fails (Lars van de Kerkhof) * Document tags no longer fail to update when replacing the document file at the same time (Matt Westcott) * Prevent error from very tall / wide images being resized to 0 pixels (Fidel Ramos) * Remove excess margin when editing snippets (Quadric) * Added `scope` attribute to table headers in TableBlock output (Quadric) * Prevent KeyError when accessing a StreamField on a deferred queryset (Paulo Alvarado) * Hide empty ‘view live’ links (Karran Besen) * Mark up a few strings for translation (Luiz Boaretto) * Invalid focal_point attribute on image edit view (Michał (Quadric) Sieradzki) * No longer expose the `.delete()` method on the default Page.objects manager (Nick Smith) * `exclude_fields_in_copy` on Page models will now work for modelcluster parental / many to many relations (LB (Ben Johnston)) * Response header (content disposition) now correctly handles filenames with non-ascii characters when using a storage backend (Rich Brennan) * Improved accessibility fixes for `main`, `header` and `footer` elements in the admin page layout (Mitchel Cabuloy) * Prevent version number from obscuring long settings menus (Naomi Morduch Toubman) * Admin views using TemplateResponse now respect the user’s language setting (Jacob Topp-Mugglestone) * Fixed incorrect language code for Japanese in language setting dropdown (Tomonori Tanabe) ## Upgrade considerations ### Removed support for Django 2.1 Django 2.1 is no longer supported as of this release; please upgrade to Django 2.2 or above before upgrading Wagtail. ### `SiteMiddleware` and `request.site` deprecated Wagtail’s `wagtail.core.middleware.SiteMiddleware`, which makes the current site object available as the property `request.site`, is now deprecated as it clashes with Django’s sites framework and makes unnecessary database queries on non-Wagtail views. References to `request.site` in your code should be removed; the recommended way of retrieving the current site is `Site.find_for_request(request)` in Python code, and the `{% wagtail_site %}` tag within Django templates. For example: ```python # old version def get_menu_items(request): return request.site.root_page.get_children().live() # new version from wagtail.core.models import Site def get_menu_items(request): return Site.find_for_request(request).root_page.get_children().live() ``` ```html+django {# old version #}

    Welcome to the {{ request.site.site_name }} website!

    {# new version #} {% load wagtailcore_tags %} {% wagtail_site as current_site %}

    Welcome to the {{ current_site.site_name }} website!

    ``` Once these are removed, `'wagtail.core.middleware.SiteMiddleware'` can be removed from your project’s `MIDDLEWARE` setting. ### Page / Collection managers no longer expose a `delete` method For [consistency with standard Django models](https://docs.djangoproject.com/en/stable/ref/models/instances/#deleting-objects), the `delete()` method is no longer available on the default Page and Collection managers. Code such as `Page.objects.delete()` should be changed to `Page.objects.all().delete()`. # 3.0.1.html.md # Wagtail 3.0.1 release notes *June 16, 2022* > * [What’s new](#what-s-new) ## What’s new ### Other features * Add warning when `WAGTAILADMIN_BASE_URL` is not configured (Matt Westcott) ### Bug fixes * Ensure `TabbedInterface` will not show a tab if no panels are visible due to permissions (Paarth Agarwal) * Specific snippets list language picker was not properly styled (Sage Abdullah) * 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) * Fix misaligned spinner icon on page action button (LB (Ben Johnston)) * Ensure radio buttons / checkboxes display vertically under Django 4.0 (Matt Westcott) * Prevent failures when splitting blocks at the start or end of a block, or with highlighted text (Jacob Topp-Mugglestone) * Allow scheduled publishing to complete when the initial editor did not have publish permission (Matt Westcott) * Stop emails from breaking when `WAGTAILADMIN_BASE_URL` is absent due to the request object not being available (Matt Westcott) * Make try/except on sending email less broad so that legitimate template rendering errors are exposed (Matt Westcott) # 3.0.2.html.md # Wagtail 3.0.2 release notes *August 30, 2022* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes * Ensure string representation of `FormSubmission` returns a string (LB (Ben Johnston)) * Fix `updatemodulepaths` command for Python 3.7 (Matt Westcott) * Fix issue where comments could not be added to already saved StreamField content (Jacob Topp-Mugglestone) * Remove outdated reference to Image.LoaderError (Matt Westcott) # 3.0.3.html.md # Wagtail 3.0.3 release notes *September 5, 2022* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes * On the Locked pages report, limit the “locked by” filter to just users who have locked pages (Stefan Hammer * Prevent JavaScript error when using StreamField on views without commenting support, such as snippets (Jacob Topp-Mugglestone) # 3.0.html.md # Wagtail 3.0 release notes *May 16, 2022* > * [What’s new](#what-s-new) > * [Upgrade considerations - changes affecting all projects](#upgrade-considerations-changes-affecting-all-projects) > * [Upgrade considerations - deprecation of old functionality](#upgrade-considerations-deprecation-of-old-functionality) > * [Upgrade considerations - changes affecting Wagtail customizations](#upgrade-considerations-changes-affecting-wagtail-customizations) ## What’s new ### Page editor redesign 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: * Fully remove the legacy sidebar, with slim sidebar replacing it for all users (Thibaud Colas) * Add support for adding custom attributes for link menu items in the slim sidebar (Thibaud Colas) * Convert all UI code to CSS logical properties for Right-to-Left (RTL) language support (Thibaud Colas) * Switch the Wagtail branding font and monospace font to a system font stack (Steven Steinwand, Paarth Agarwal, Rishank Kanaparti) * Remove most uppercased text styles from admin UI (Paarth Agarwal) * Implement new tabs design across the admin interface (Steven Steinwand) Other changes that are specific to the Page Editor include: * Implement new slim page editor header with breadcrumb and secondary page menu (Steven Steinwand, Karl Hobley) * Move page meta information from the header to a new status side panel component inside of the page editing UI (Steven Steinwand, Karl Hobley) Further updates to the page editor are expected in the next release. Development on this feature was sponsored by Google. ### Rich text block splitting 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. ### Removal of special-purpose field panel types 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. ### Permission-dependent FieldPanels [`FieldPanel`](../reference/panels.md#wagtail.admin.panels.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. ### Page descriptions 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: ```python class LandingPage(Page): page_description = "Use this page for converting users" ``` ### Image duplicate detection 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. ### Image renditions can now be prefetched 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. ### Other features * Upgrade ESLint and Stylelint configurations to latest shared Wagtail configs (Thibaud Colas, Paarth Agarwal) * Major updates to frontend tooling; move Node tooling from Gulp to Webpack, upgrade to Node v16 and npm v8, eslint v8, stylelint v14 and others (Thibaud Colas) * Change comment headers’ date formatting to use browser APIs instead of requiring a library (LB (Ben Johnston)) * Lint with flake8-comprehensions and flake8-assertive, including adding a pre-commit hook for these (Mads Jensen, Dan Braghis) * Add black configuration and reformat code using it (Dan Braghis) * Remove UI code for legacy browser support: polyfills, IE11 workarounds, Modernizr (Thibaud Colas) * Remove redirect auto-creation recipe from documentation as this feature is now supported in Wagtail core (Andy Babic) * Remove IE11 warnings (Gianluca De Cola) * Replace `content_json` `TextField` with `content` `JSONField` in `PageRevision` (Sage Abdullah) * Remove `replace_text` management command (Sage Abdullah) * Replace `data_json` `TextField` with `data` `JSONField` in `BaseLogEntry` (Sage Abdullah) * Remove the legacy Hallo rich text editor as it has moved to an external package (LB (Ben Johnston)) * Increase the size of checkboxes throughout the UI, and simplify their alignment (Steven Steinwand) * Adopt [MyST](https://myst-parser.readthedocs.io/en/stable/index.html) for parsing documentation written in Markdown, replaces recommonmark (LB (Ben Johnston), Thibaud Colas) * Installing docs extras requirements in CircleCI so issues with the docs requirements are picked up earlier (Thibaud Colas) * Remove core usage of jinjalint and migrate to curlylint to resolve dependency incompatibility issues (Thibaud Colas) * Switch focus outlines implementation to `:focus-visible` for cross-browser consistency (Paarth Agarwal) * Migrate multiple documentation pages from RST to MD - including the editor’s guide (Vibhakar Solanki, LB (Ben Johnston), Shwet Khatri) * Add documentation for defining custom form validation on models used in Wagtail’s `ModelAdmin` (Serafeim Papastefanos) * Update `README.md` logo to work for GitHub dark mode (Paarth Agarwal) * Avoid an unnecessary page reload when pressing enter within the header search bar (Images, Pages, Documents) (Riley de Mestre) * Removed unofficial length parameter on `If-Modified-Since` header in `sendfile_streaming_backend` which was only used by IE (Mariusz Felisiak) * Add Pinterest support to the list of default oEmbed providers (Dharmik Gangani) * Update Jinja2 template support for Jinja2 3.1 (Seb Brown) * Add ability for `StreamField` to use `JSONField` to store data, rather than `TextField` (Sage Abdullah) * Split up linting / formatting tasks in Makefile into client and server components (Hitansh Shah) * Add support for embedding Instagram reels (Luis Nell) * Use Django’s JavaScript catalog feature to manage translatable strings in JavaScript (Karl Hobley) * Add `trimmed` attribute to all blocktrans tags, so spacing is more reliable in translated strings (Harris Lapiroff) * Add documentation that describes how to use `ModelAdmin` to manage `Tag`s (Abdulmajeed Isa) * Rename the setting `BASE_URL` (undocumented) to [`WAGTAILADMIN_BASE_URL`](../reference/settings.md#wagtailadmin-base-url) and add to documentation, `BASE_URL` will be removed in a future release (Sandil Ranasinghe) * Validate to and from email addresses within form builder pages when using `AbstractEmailForm` (Jake Howard) * Add [`WAGTAILIMAGES_RENDITION_STORAGE`](../reference/settings.md#wagtailimages-rendition-storage) setting to allow an alternative image rendition storage (Heather White) * Add [`wagtail_update_image_renditions` management command](../reference/management_commands.md#wagtail-update-image-renditions) to regenerate image renditions or purge all existing renditions (Hitansh Shah, Onno Timmerman, Damian Moore) * Add the ability for choices to be separated by new lines instead of just commas within the form builder, commas will still be supported if used (Abdulmajeed Isa) * Add internationalisation UI to modeladmin (Andrés Martano) * Support chunking in `PageQuerySet.specific()` to reduce memory consumption (Andy Babic) * Add useful help text to Tag fields to advise what content is allowed inside tags, including when `TAG_SPACES_ALLOWED` is `True` or `False` (Abdulmajeed Isa) * Change `AbstractFormSubmission`’s `form_data` to use JSONField to store form submissions (Jake Howard) ### Bug fixes * Update django-treebeard dependency to 4.5.1 or above (Serafeim Papastefanos) * When using `simple_translations` ensure that the user is redirected to the page edit view when submitting for a single locale (Mitchel Cabuloy) * When previewing unsaved changes to `Form` pages, ensure that all added fields are correctly shown in the preview (Joshua Munn) * When Documents (e.g. PDFs) have been configured to be served inline via `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) * Improve the contrast of the “Remember me” checkbox against the login page’s background (Steven Steinwand) * Group permission rows with custom permissions no longer have extra padding (Steven Steinwand) * Make sure the focus outline of checkboxes is fully around the outer border (Steven Steinwand) * Consistently set `aria-haspopup="menu"` for all sidebar menu items that have sub-menus (LB (Ben Johnston)) * Make sure `aria-expanded` is always explicitly set as a string in sidebar (LB (Ben Johnston)) * Use a button element instead of a link for page explorer menu item, for the correct semantics and behavior (LB (Ben Johnston)) * Make sure the “Title” column label can be translated in the page chooser and page move UI (Stephanie Cheng Smith) * Remove redundant `role="main"` attributes on `
    ` elements causing HTML validation issues (Luis Espinoza) * Allow bulk publishing of pages without revisions (Andy Chosak) * Stop skipping heading levels in Wagtail welcome page (Jesse Menn) * Add missing `lang` attributes to `` elements (James Ray) * Add missing translation usage in Workflow templates (Anuja Verma, Saurabh Kumar) * Avoid 503 server error when entering tags over 100chars and instead show a user facing validation error (Vu Pham, Khanh Hoang) * Ensure `thumb_col_header_text` is correctly used by `ThumbnailMixin` within `ModelAdmin` as the column header label (Kyle J. Roux) * Ensure page copy in Wagtail admin doesn’t ignore `exclude_fields_in_copy` (John-Scott Atlakson) * Generate new translation keys for translatable `Orderable`s when page is copied without being published (Kalob Taulien, Dan Braghis) * Ignore `GenericRelation` when copying pages (John-Scott Atlakson) * Implement ARIA tabs markup and keyboards interactions for admin tabs (Steven Steinwand) * Ensure `wagtail updatemodulepaths` works when system locale is not UTF-8 (Matt Westcott) * Re-establish focus trap for Pages explorer in slim sidebar (Thibaud Colas) * Ensure the icon font loads correctly when `STATIC_URL` is not `"/static/"` (Jacob Topp-Mugglestone) ## Upgrade considerations - changes affecting all projects ### Changes to module paths Various modules of Wagtail have been reorganized, and imports should be updated as follows: * The `wagtail.core.utils` module is renamed to `wagtail.coreutils` * All other modules under `wagtail.core` can now be found under `wagtail` - for example, `from wagtail.core.models import Page` should be changed to `from wagtail.models import Page` * The `wagtail.tests` module is renamed to `wagtail.test` * `wagtail.admin.edit_handlers` is renamed to `wagtail.admin.panels` * `wagtail.contrib.forms.edit_handlers` is renamed to `wagtail.contrib.forms.panels` These changes can be applied automatically to your project codebase by running the following commands from the project root: ```sh 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 ``` ### Removal of special-purpose field panel types 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_URL` References to `BASE_URL` in your settings should be updated to [`WAGTAILADMIN_BASE_URL`](../reference/settings.md#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 `StreamField` All 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. ### SQLite now requires the `JSON1` extension enabled Due to [`JSONField`](https://docs.djangoproject.com/en/stable/ref/models/fields/#django.db.models.JSONField) requirements, SQLite will only be supported with the JSON1 extension enabled. See [Enabling JSON1 extension on SQLite](https://docs.djangoproject.com/en/stable/ref/databases/#sqlite-json1) and [JSON1 extension](https://www.sqlite.org/json1.html) for details. ## Upgrade considerations - deprecation of old functionality ### Removed support for Internet Explorer (IE11) 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](https://learn.microsoft.com/en-us/deployedge/edge-ie-mode) to keep access to IE11-only sites, while other sites and apps like Wagtail can leverage modern browser capabilities. ### Hallo legacy rich text editor has moved to an external package Hallo was deprecated in [Wagtail v2.0 (February 2018)](https://docs.wagtail.org/en/stable/releases/2.0.html#new-rich-text-editor) 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](https://github.com/wagtail/wagtail-hallo) 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. ### Removal of legacy `clean_name` on `AbstractFormField` If you are upgrading a pre-2.10 project that uses the [Wagtail form builder](../reference/contrib/forms/index.md#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](https://pypi.org/project/Unidecode/) package) has been dropped in Wagtail 3.0. Any new form fields created under Wagtail 2.10 or above use the [AnyAscii](https://pypi.org/project/anyascii/) library instead. ### Removed support for Jinja2 2.x 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. ## Upgrade considerations - changes affecting Wagtail customizations ### API changes to panels (EditHandlers) 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: * If the panel sets a custom template, your code should instead define [a `Widget` class](https://docs.djangoproject.com/en/stable/ref/forms/widgets/) that produces your desired HTML rendering. * If the panel provides a `widget_overrides` method, your code should instead call [`register_form_field_override`](../extending/forms.md) so that the desired widget is always selected for the relevant model field type. * If the panel provides a `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: * Panels that define `required_fields` should instead return this value as a `fields` item in the dict returned from `get_form_options` * Panels that define `required_formsets` should instead return this value as a `formsets` item in the dict returned from `get_form_options` * Panels that define `widget_overrides` should instead return this value as a `widgets` item in the dict returned from `get_form_options` The 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](../advanced_topics/customization/page_editing_interface.md#custom-edit-handler-forms) 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`: ```python 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. ### API changes to ModelAdmin Some changes of behavior have been made to ModelAdmin as a result of the panel API changes: * When overriding the `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. * The `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`. * The `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. ### Replaced `content_json` `TextField` with `content` `JSONField` in `PageRevision` The `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. ### Replaced `data_json` `TextField` with `data` `JSONField` in `BaseLogEntry` The `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: ```python 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: ```python 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", ), ] ``` ### Replaced `form_data` `TextField` with `JSONField` in `AbstractFormSubmission` The `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 ```python 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 ) ``` ### Removed `size` argument from `wagtail.utils.sendfile_streaming_backend.was_modified_since` The `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](https://httpwg.org/specs/rfc7232.html#header.if-modified-since) and existed only as a an unofficial implementation in IE browsers. # 4.0.1.html.md # Wagtail 4.0.1 release notes *September 5, 2022* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes * On the Locked pages report, limit the “locked by” filter to just users who have locked pages (Stefan Hammer) * Prevent JavaScript error when using StreamField on views without commenting support, such as snippets (Jacob Topp-Mugglestone) * Modify base template for new projects so that links opened from the preview panel open in a new window (Sage Abdullah) * Prevent circular import error between custom document models and document chooser blocks (Matt Westcott) # 4.0.2.html.md # Wagtail 4.0.2 release notes *September 23, 2022* > * [What’s new](#what-s-new) ## What’s new * 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) * Ensure all images in the documentation have a suitable alt text (Thibaud Colas) ### Bug fixes * Ensure tag autocompletion dropdown has a solid background (LB (Ben) Johnston) * Allow inline panels to be ordered (LB (Ben) Johnston) * Only show draft / live status tags on snippets that have `DraftStateMixin` applied (Sage Abdullah) * Prevent JS error when initializing chooser modals with no tabs (LB (Ben) Johnston) * Add missing vertical spacing between chooser modal header and body when there are no tabs (LB (Ben) Johnston) * Reinstate specific labels for chooser buttons (for example ‘Choose another page’, ‘Edit this page’ not ‘Change’, ‘Edit’) so that it is clearer for users and non-English translations (Matt Westcott) * Resolve issue where searches with a tag and a query param in the image listing would result in an `FilterFieldError` (Stefan Hammer) * Add missing vertical space between header and content in embed chooser modal (LB (Ben) Johnston) * Use the correct type scale for heading levels in rich text (Steven Steinwand) * Update alignment and reveal logic of fields’ comment buttons (Steven Steinwand) * Regression from Markdown conversion in documentation for API configuration - update to correctly use PEP-8 for example code (Storm Heg) * Prevent ‘Delete’ link on page edit view from redirecting back to the deleted page (LB (Ben) Johnston) * Prevent JS error on images index view when collections dropdown is omitted (Tidiane Dia) * Prevent “Entries per page” dropdown on images index view from reverting to 10 (Tidiane Dia) * Set related_name on user revision relation to avoid conflict with django-reversion (Matt Westcott) * Ensure the “recent edits” panel on the Dashboard (home) page works when page record is missing (Matt Westcott) * Only add Translate buttons when the `simple_translation` app is installed (Dan Braghis) * Ensure that `MultiFieldPanel` correctly outputs all child classnames in the template (Matt Westcott) * Remove over-eager caching on ModelAdmin permission checks (Matt Westcott, Stefan Hammer) # 4.0.4.html.md # Wagtail 4.0.4 release notes *October 18, 2022* > * [What’s new](#what-s-new) ## What’s new * Render `help_text` when set on `FieldPanel`, `MultiFieldPanel`, `FieldRowPanel`, and other panel APIs where it previously worked without official support (Matt Westcott) * Update special-purpose `FieldPanel` deprecation message to add clarity for developers (Matt Westcott) ### Bug fixes * Add back rendering of `help_text` for InlinePanel (Matt Westcott) * Ensure that `AbstractForm` & `AbstractEmailForm` page models correctly pass the form to the preview context (Dan Bentley) * Use the correct custom font for the Wagtail userbar (Umar Farouk Yunusa) * Ensure that buttons on custom chooser widgets are correctly shown on hover (Thibaud Colas) # 4.0.html.md # Wagtail 4.0 release notes *August 31, 2022* > * [What’s new](#what-s-new) > * [Upgrade considerations](#upgrade-considerations) ## What’s new ### Django 4.1 support 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. ### Global settings models 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](../reference/contrib/settings.md) for more information. This feature was implemented by Kyle Bayliss. ### Image renditions can now be prefetched by filter 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 [Prefetching image renditions](../advanced_topics/images/renditions.md#prefetching-image-renditions) for more examples. This feature was developed by Tidiane Dia and Karl Hobley. ### Page editor redesign 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: * Updating all widget styles across the admin UI, including basic form widgets, as well as choosers. * Updating field styles across forms, with help text consistently under fields, error messages above, and comment buttons to the side. * Making all sections of the page editing UI collapsible by default. * New designs for StreamField and InlinePanel blocks, with better support for nested blocks. * Updating the side panels to prevent overlap with form fields unless necessary. 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 As part of the page editor redesign project sponsored by Google, we have made several improvements to our rich text editor: * Inline toolbar: The toolbar now shows inline, to avoid clashing with the page’s header. * Command palette: Start a block with a slash ‘/’ to open the palette and change the text format. * Character count: The character count is displayed underneath the editor, live-updating as you type. This counts the length of the text, not of any formatting. * Paste to auto-create links: To add a link from your copy-paste clipboard, select text and paste the URL. * Text shortcuts undo: The editor normally converts text starting with `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. * RTL support: The editor’s UI now displays correctly in right-to-left languages. * Focus-aware placeholder: The editor’s placeholder text will now follow the user’s focus, to make it easier to understand where to type in long fields. * Empty heading highlight: The editor now highlights empty headings and list items by showing their type (“Heading 3”) as a placeholder, so content is less likely to be published with empty headings. * Split and insert: rich text fields can now be split while inserting a new StreamField block of the desired type. ### Live preview panel 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. ### Admin color themes 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 [Custom user interface colors](../advanced_topics/customization/admin_templates.md#custom-user-interface-colors) 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. ### Windows High Contrast mode support improvements 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](https://github.com/wagtail/wagtail/discussions/8193) Google Summer of Code project, with support from Jane Hughes, Scott Cranfill, and Thibaud Colas. * Improve help block styles with less reliance on communication via color alone in forced colors mode * Add a bottom border to top messages so they stand out from the header in forced colors mode * Make progress bars’ progress visible in forced colors mode * Make checkboxes visible in forced colors mode * Display the correct color for icons in forced colors mode * Add a border around modal dialogs so they can be identified in forced colors mode * Ensure disabled buttons are distinguishable from active buttons in forced colors mode * Ensure that the fields on login and password reset forms are visible in forced colors mode * Missing an outline on dropdown content and malformed tooltip arrow in forced colors mode ### UX unification and consistency improvements 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](https://github.com/wagtail/wagtail/discussions/8158) 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. * **Login and password reset** * Refreshed design for login and password reset pages to better suit a wider range of device sizes * Better accessibility and screen reader support for the sign-in form due to a more appropriate DOM structure and skip link improvements * Remove usage of inline script to focus on username field and instead use `autofocus` * Wagtail logo added with the ability to override this logo via [Custom branding](../advanced_topics/customization/admin_templates.md#custom-branding) * **Breadcrumbs** * Add Breadcrumbs to the Wagtail pattern library * Enhance new breadcrumbs so they can be added to any header or container element * Adopt new breadcrumbs on the page explorer (listing) view and the page chooser modal, remove legacy breadcrumbs code for move page as no longer used * Rename `explorer_breadcrumb` template tag to `breadcrumbs` as it is now used in multiple locations * Remove legacy (non-next) breadcrumbs no longer used, remove `ModelAdmin` usage of breadcrumbs completely and adopt consistent ‘back’ link approach * **Headers** * Update classes and styles for the shared header templates to align with UI guidelines * Ensure the shared header template is more reusable, add ability to include classes, extra content and other blocks * Switch all report workflow, redirects, form submissions, site settings views to use Wagtail’s reusable header component * Resolve issues throughout Wagtail where the sidebar toggle would overlap header content on small devices * **Tabs** * Add Tabs to the Wagtail pattern library * Adopt new Tabs component in the workflow history report page, removing the bespoke implementation there * **Dashboard (home) view** * Migrate the dashboard (home) view header to the shared header template and update designs * Refresh designs for Home (Dashboard) site summary panels, use theme spacing and colors * Add support for RTL layouts and better support for small devices * Add CSS support for more than three summary items if added via customizations * **Page Listing view** * Adopt the slim header in page listing views, with buttons moved under the “Actions” dropdown * Add convenient access to the translate page button in the parent “more” button ### Previews, revisions and drafts for snippets Snippets 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: * [Making snippets previewable](../topics/snippets/features.md#wagtailsnippets-making-snippets-previewable) * [Saving revisions of snippets](../topics/snippets/features.md#wagtailsnippets-saving-revisions-of-snippets) * [Saving draft changes of snippets](../topics/snippets/features.md#wagtailsnippets-saving-draft-changes-of-snippets) These features were developed by Sage Abdullah. ### Documentation improvements 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; * Convert the rest of the documentation to Markdown, in place of RST, which will make it much easier for others to contribute to better documentation (Khanh Hoang, Vu Pham, Daniel Kirkham, LB (Ben) Johnston, Thiago Costa de Souza, Benedict Faw, Noble Mittal, Sævar Öfjörð Magnússon, Sandeep M A, Stefano Silvestri) * Replace latin abbreviations (i.e. / e.g.) with common English phrases so that documentation is easier to understand (Dominik Lech) * Improve the organization of the settings reference page with logical grouping and better internal linking (Akash Kumar Sen) * Improve the accessibility of the documentation with higher contrast colors, consistent focus outline, better keyboard only navigation through the sidebar (LB (Ben) Johnston, Vince Salvino) * Better sidebar scrolling behavior, it is now sticky on larger devices and scrollable on its own (Paarth Agarwal, LB (Ben) Johnston) * Fix links showing incorrectly in Safari (Tibor Leupold) * See other features below for new feature specific documentation added. ### Other features * Add clarity to confirmation when being asked to convert an external link to an internal one (Thijs Kramer) * Add `base_url_path` to `ModelAdmin` so that the default URL structure of app_label/model_name can be overridden (Vu Pham, Khanh Hoang) * Add `full_url` to the API output of `ImageRenditionField` (Paarth Agarwal) * Use `InlinePanel`’s label when available for field comparison label (Sandil Ranasinghe) * Drop support for Safari 13 by removing left/right positioning in favor of CSS logical properties (Thibaud Colas) * Use `FormData` instead of jQuery’s `form.serialize` when editing documents or images just added so that additional fields can be better supported (Stefan Hammer) * Add informational Codecov status checks for GitHub CI pipelines (Tom Hu) * Make it possible to reuse and customize Wagtail’s fonts with CSS variables (LB (Ben) Johnston) * Add better handling and informative developer errors for cross linking URLS (e.g. success after add) in generic views `wagtail.admin.views.generic` (Matt Westcott) * Introduce `wagtail.admin.widgets.chooser.BaseChooser` to make it easier to build custom chooser inputs (Matt Westcott) * Introduce JavaScript chooser module, including a SearchController class which encapsulates the standard pattern of re-rendering the results panel in response to search queries and pagination (Matt Westcott) * Migrate Image and Document choosers to new JavaScript chooser module (Matt Westcott) * Add ability to select multiple items at once within bulk actions selections when holding shift on subsequent clicks (Hitansh Shah) * Upgrade notification, shown to admins on the dashboard if Wagtail is out of date, will now link to the release notes for the closest minor branch instead of the latest patch (Tibor Leupold) * Upgrade notification can now be configured to only show updates when there is a new LTS available via `WAGTAIL_ENABLE_UPDATE_CHECK = 'lts'` (Tibor Leupold) * Implement redesign of the Workflow Status dialog, fixing accessibility issues (Steven Steinwand) * Add the ability to change the number of images displayed per page in the image library (Tidiane Dia, with sponsorship from YouGov) * Allow users to sort by different fields in the image library (Tidiane Dia, with sponsorship from YouGov) * Add `prefetch_renditions` method to `ImageQueryset` for performance optimization on image listings (Tidiane Dia, Karl Hobley) * Add ability to define a custom `get_field_clean_name` method when defining `FormField` models that extend `AbstractFormField` (LB (Ben) Johnston) * Migrate Home (Dashboard) view to use generic Wagtail class based view (LB (Ben) Johnston) * Combine most of Wagtail’s stylesheets into the global `core.css` file (Thibaud Colas) * Update `ReportView` to extend from generic `wagtail.admin.views.generic.models.IndexView` (Sage Abdullah) * Update pages `Unpublish` view to extend from generic `wagtail.admin.views.generic.models.UnpublishView` (Sage Abdullah) * Introduce a `wagtail.admin.viewsets.chooser.ChooserViewSet` module to serve as a common base implementation for chooser modals (Matt Westcott) * Add documentation for `wagtail.admin.viewsets.model.ModelViewSet` (Matt Westcott) * Added [multi-site support](../advanced_topics/api/v2/usage.md#api-filtering-pages-by-site) to the API (Sævar Öfjörð Magnússon) * Add `add_to_admin_menu` option for `ModelAdmin` (Oliver Parker) * Implement [Fuzzy matching](../topics/search/searching.md#fuzzy-matching) for Elasticsearch (Nick Smith) * Cache model permission codenames in `PermissionHelper` (Tidiane Dia) * Selecting a new parent page for moving a page now uses the chooser modal which allows searching (Viggo de Vries) * Add clarity to the search indexing documentation for how `boost` works when using Postgres with the database search backend (Tibor Leupold) * Updated `django-filter` version to support 22 (Yuekui) * Use `.iterator()` in a few more places in the admin, to make it more stable on sites with many pages (Andy Babic) * Migrate some simple React component files to TypeScript (LB (Ben) Johnston) * Deprecate the usage and documentation of the `wagtail.contrib.modeladmin.menus.SubMenu` class, provide a warning if used directing developers to use `wagtail.admin.menu.Menu` instead (Matt Westcott) * Replace human-readable-date hover pattern with accessible tooltip variant across all of admin (Bernd de Ridder) * Added `WAGTAILADMIN_USER_PASSWORD_RESET_FORM` setting for overriding the admin password reset form (Michael Karamuth) * Prefetch workflow states in edit page view to avoid queries in other parts of the view/templates that need it (Tidiane Dia) * Remove the edit link from edit bird in previews to avoid confusion (Sævar Öfjörð Magnússon) * Introduce new template fragment and block level enclosure tags for easier template composition (Thibaud Colas) * Add a `classnames` template tag to easily build up classes from variables provided to a template (Paarth Agarwal) * Clean up multiple eslint rules usage and configs to align better with the Wagtail coding guidelines (LB (Ben Johnston)) * Make `ModelAdmin` `InspectView` footer actions consistent with other parts of the UI (Thibaud Colas) * Add support for Twitter and other text-only embeds in Draftail embed previews (Iman Syed, Paarth Agarwal) * Use new modal dialog component for privacy settings modal (Sage Abdullah) * Add `menu_item_name` to modify `MenuItem`’s name for `ModelAdmin` (Alexander Rogovskyy, Vu Pham) * Add an extra confirmation prompt when deleting pages with a large number of child pages, see [WAGTAILADMIN_UNSAFE_PAGE_DELETION_LIMIT](../reference/settings.md#wagtailadmin-unsafe-page-deletion-limit) (Jaspreet Singh) * Add shortcut for accessing StreamField blocks by block name with new [`blocks_by_name` and `first_block_by_name` methods on `StreamValue`](../topics/streamfield.md#streamfield-retrieving-blocks-by-name) (Tidiane Dia, Matt Westcott) * Add HTML-aware max_length validation and character count on RichTextField and RichTextBlock (Matt Westcott, Thibaud Colas) * Remove `is_parent` kwarg in various page button hooks as this approach is no longer required (Paarth Agarwal) * Improve security of redirect imports by adding a file hash (signature) check for so that any tampering of file contents between requests will throw a `BadSignature` error (Jaap Roes) * Allow generic chooser viewsets to support non-model data such as an API endpoint (Matt Westcott) * Added `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) * Introduce new template fragment and block level enclosure tags for easier template composition (Thibaud Colas) * Implement the new chooser widget styles as part of the page editor redesign (Thibaud Colas) * Update base Draftail/TextField form designs as part of the page editor redesign (Thibaud Colas) * Move commenting trigger to inline toolbar and move block splitting to the block toolbar and command palette only in Draftail (Thibaud Colas) * Pages are now locked when they are scheduled for publishing (Karl Hobley) * Simplify page chooser views by converting to class-based views (Matt Westcott) * Add “Translate” button within pages’ Actions dropdown when editing pages (Sage Abdullah) * Add translated labels to the bulk actions tags and collections bulk update fields (Stefan Hammer) * Add support for bulk actions, including [Adding bulk actions to the snippets listing](../extending/custom_bulk_actions.md#wagtailsnippets-custom-bulk-actions) (Shohan Dutta Roy) ### Bug fixes * Fix issue where `ModelAdmin` index listings with export list enabled would show buttons with an incorrect layout (Josh Woodcock) * Fix typo in `ResumeWorkflowActionFormatter` message (Stefan Hammer) * Throw a meaningful error when saving an image to an unrecognized image format (Christian Franke) * Remove extra padding for headers with breadcrumbs on mobile viewport (Steven Steinwand) * Replace `PageRevision` with generic `Revision` model (Sage Abdullah) * Ensure that custom document or image models support custom tag models (Matt Westcott) * Ensure comments use translated values for their placeholder text (Stefan Hammer) * Ensure the upgrade notification, shown to admins on the dashboard if Wagtail is out of date, content is translatable (LB (Ben) Johnston) * Only show the re-ordering option to users that have permission to publish pages within the page listing (Stefan Hammer) * Ensure default sidebar branding (bird logo) is not cropped in RTL mode (Steven Steinwand) * Add an accessible label to the image focal point input when editing images (Lucie Le Frapper) * Remove unused header search JavaScript on the redirects import page (LB (Ben) Johnston) * Ensure non-square avatar images will correctly show throughout the admin (LB (Ben) Johnston) * Ignore translations in test files and re-include some translations that were accidentally ignored (Stefan Hammer) * Show alternative message when no page types are available to be created (Jaspreet Singh) * Prevent error on sending notifications for the legacy moderation process when no user was specified (Yves Serrano) * Ensure `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)) * Revise the `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) * Ensure that `DecimalBlock` preserves the `Decimal` type when retrieving from the database (Yves Serrano) * When no snippets are added, ensure the snippet chooser modal has the correct URL for creating a new snippet (Matt Westcott) * `ngettext` in Wagtail’s internal JavaScript internationalisation utilities now works (LB (Ben) Johnston) * Ensure the linting/formatting npm scripts work on Windows (Anuja Verma) * Fix display of dates in exported xlsx files on macOS Preview and Numbers (Jaap Roes) * Remove outdated reference to 30-character limit on usernames in help text (minusf) * Resolve multiple form submissions index listing page layout issues including title not being visible on mobile and interaction with large tables (Paarth Agarwal) * Ensure `ModelAdmin` single selection lists show correctly with Django 4.0 form template changes (Coen van der Kamp) * Ensure icons within help blocks have accessible contrasting colors, and links have a darker color plus underline to indicate they are links (Paarth Agarwal) * Ensure consistent sidebar icon position whether expanded or collapsed (Scott Cranfill) * Avoid redirects import error if the file had lots of columns (Jaap Roes) * Resolve accessibility and styling issues with the expanding status panel (Sage Abdullah) * Avoid 503 `AttributeError` when an empty search param `q=` is combined with other filters in the Images index view (Paritosh Kabra) * Fix error with string representation of FormSubmission not returning a string (LB (Ben) Johnston) * Ensure that bulk actions correctly support models with non-integer primary keys (id) (LB (Ben) Johnston) * Make it possible to toggle collapsible panels in the edit UI with the keyboard (Thibaud Colas) * Re-implement checkbox styles so the checked state is visible in forced colors mode (Thibaud Colas) * Re-implement switch component styles so the checked state is visible in forced colors mode (Thibaud Colas) * Always render select widgets consistently regardless of where they are in the admin (Thibaud Colas) * Make sure input labels and always take up the available space (Thibaud Colas) * Correctly style BooleanBlock within StructBlock (Thibaud Colas) * Make sure comment icons can’t overlap with help text (Thibaud Colas) * Make it possible to scroll input fields in admin on safari mobile (Thibaud Colas) * Stop rich text fields from overlapping with sidebar (Thibaud Colas) * Prevent comment buttons from overlapping with fields (Thibaud Colas) * Resolve MySQL search compatibility issue with Django 4.1 (Andy Chosak) * Resolve layout issues with reports (including form submissions listings) on md device widths (Akash Kumar Sen, LB (Ben) Johnston) * Resolve Layout issue with page explorer’s inner header item on small device widths (Akash Kumar Sen) * Ensure that `BaseSiteSetting` / `BaseGenericSetting` objects can be pickled (Andy Babic) * Ensure `DocumentChooserBlock` can be deconstructed for migrations (Matt Westcott) * Resolve frontend console error and unintended console logging issues (Matt Westcott, Paarth Agarwal) * Resolve issue with sites that have not yet migrated away from `BaseSetting` when upgrading to Wagtail 4.0 (Stefan Hammer) * Use correct classnames for showing/hiding edit button on chooser widget (Matt Westcott) * Render MultiFieldPanel’s heading even when nested (Thibaud Colas) * Make sure select widgets render correctly regardless of the Django field and widget type (Thibaud Colas) * Consistently display boolean field labels above the widget so they render correctly (Thibaud Colas) * Address form field label alignment issues by always displaying labels above the widget (Thibaud Colas) * Make sure rich text URL editing tooltip is fully visible when displayed inside InlinePanel blocks (Thibaud Colas) * Allow input fields to scroll horizontally in Safari iOS (Thibaud Colas) * Ensure screen readers are made aware of page level messages added dynamically to the top of the page (Paarth Agarwal) * Fix `updatemodulepaths` command for Python 3.7 (Matt Westcott) * Only show locale filter in choosers when i18n is enabled in settings (Matt Westcott) * Ensure that the live preview panel correctly clears the cache when a new page is created (Sage Abdullah) * Ensure that there is a larger hoverable area for add block (+) within the Draftail editor (Steven Steinwand) * Resolve multiple header styling issues for modal, alignment on small devices, outside click handling target on medium devices, close button target size and hover styles (Paarth Agarwal) * Fix issue where comments could not be added in StreamField that were already saved (Jacob Topp-Mugglestone) * Remove outdated reference to Image.LoaderError (Matt Westcott) ## Upgrade considerations ### Changes to `Page.serve()` and `Page.serve_preview()` methods As 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. ### Opening links within the live preview panel 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 `` tag within your `` element in your `base.html` template, before any `` elements: ```html+django {% if request.in_preview_panel %} {% 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 AdminURLHelper The `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. ### Dropped support for Safari 13 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 `Revision` The `PageRevision` model has been replaced with a generic `Revision` model. If you use the `PageRevision` model in your code, make sure that: * Creation of `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`. * Queries that use the `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())`). * Access to `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: ```python 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_object` The `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 `BaseChooser` Custom 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_handler` The `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 removed The `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 deprecated The `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. ### Chooser widget JavaScript initializers replaced with classes 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)` ### URL route names for image, document and snippet apps have changed 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:choose` * `wagtailimages:chooser_results` is now `wagtailimages_chooser:choose_results` * `wagtailimages:image_chosen` is now `wagtailimages_chooser:chosen` * `wagtailimages:chooser_upload` is now `wagtailimages_chooser:create` * `wagtailimages:chooser_select_format` is now `wagtailimages_chooser:select_format` * `wagtaildocs:chooser` is now `wagtaildocs_chooser:choose` * `wagtaildocs:chooser_results` is now `wagtaildocs_chooser:choose_results` * `wagtaildocs:document_chosen` is now `wagtaildocs_chooser:chosen` * `wagtaildocs:chooser_upload` is now `wagtaildocs_chooser:create` * `wagtailsnippets: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. ### Auto-updating preview 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. ### Slim header on page listings 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`](../reference/hooks.md#register-page-header-buttons) hook, rather than [`register_page_listing_buttons`](../reference/hooks.md#register-page-listing-buttons) and [`register_page_listing_more_buttons`](../reference/hooks.md#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 hooks * The following hooks `construct_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. ### Changed CSS variables for admin color themes 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 [Custom user interface colors](../advanced_topics/customization/admin_templates.md#custom-user-interface-colors) 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-lightness` We’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` / `BaseImageForm` Previously, 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. ### Panel customizations 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. ### Optional replacement for regex only `route` decorator for `RoutablePageMixin` - This is an optional replacement, there are no immediate plans to remove the `route` decorator at this time. - The `RoutablePageMixin` contrib module now provides a `path` decorator that behaves the same way as Django’s [`django.urls.path()`](https://docs.djangoproject.com/en/stable/ref/urls/#django.urls.path) function. - `RoutablePageMixin`’s `route` decorator will now redirect to a new `re_path` decorator that emulates the behavior of [`django.urls.re_path()`](https://docs.djangoproject.com/en/stable/ref/urls/#django.urls.re_path). ### `BaseSetting` model replaced by `BaseSiteSetting` The `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: ```python from wagtail.contrib.settings.models import BaseSetting, register_setting @register_setting class SiteSpecificSocialMediaSettings(BaseSetting): facebook = models.URLField() ``` should become ```python from wagtail.contrib.settings.models import BaseSiteSetting, register_setting @register_setting class SiteSpecificSocialMediaSettings(BaseSiteSetting): facebook = models.URLField() ``` # 4.1.1.html.md # Wagtail 4.1.1 release notes *November 11, 2022* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes * 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) * Fix disabled style on StreamField add button (Matt Westcott) * Ensure models are fully loaded before registering snippets, to avoid circular import issues (Matt Westcott) * Prevent fields without a `verbose_name` property from breaking usage report views (Matt Westcott) * Exclude tags from the reference index (Matt Westcott) * Fix errors in handling generic foreign keys when populating the reference index (Matt Westcott) * Prevent error in handling null ParentalKeys when populating the reference index (Matt Westcott) * Make sure minimap error indicators follow the minimap scrolling (Thibaud Colas) * Ensure background HTTP request to clear stale preview data correctly respects the `CSRF_HEADER_NAME` setting (Sage Abdullah) * Prevent error on aging pages report when “Last published by” user has been deleted (Joshua Munn) # 4.1.2.html.md # Wagtail 4.1.2 release notes *February 6, 2023* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes * Make “Cancel scheduled publish” button correctly redirect back to the edit view (Sage Abdullah) * Prevent crash when reverting revisions on a snippet with `PreviewableMixin` applied (Sage Abdullah) * Use consistent heading styles on top-level fields in the page editor (Sage Abdullah) * Allow button labels to wrap onto two lines in dropdown buttons (Coen van der Kamp) * Move DateField, DateTimeField, TimeField comment buttons to be right next to the fields (Theresa Okoro) * Support text resizing in workflow steps cards (Ivy Jeptoo) * Use the correct padding for autocomplete block picker (Umar Farouk Yunusa) * Fix horizontal positioning of rich text inline toolbar (Thibaud Colas) * Close the userbar when clicking its toggle (Albina Starykova) * Do not show bulk actions checkbox in page type usage view (Sage Abdullah) * Prevent account name from overflowing the sidebar (Aman Pandey) * Ensure edit form is displayed as unlocked immediately after canceling a workflow (Sage Abdullah) * Prevent `latest_revision` pointer from being copied over when copying translatable snippets for translation (Sage Abdullah) ### Documentation * Document potential data loss for BaseLogEntry migration in 3.0 (Sage Abdullah) * Add documentation for the reference index mechanism (Daniel Kirkham) # 4.1.3.html.md # Wagtail 4.1.3 release notes *March 13, 2023* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes * Add right-to-left (RTL) support for the following form components: Switch, Minimap, live preview (Thibaud Colas) * Improve right-to-left (RTL) positioning for the following components: Page explorer, Sidebar sub-menu, rich text tooltips, rich text toolbar trigger, editor section headers (Thibaud Colas) * Ensure links within help blocks meet color contrast guidelines for accessibility (Theresa Okoro) * Support creating `StructValue` copies (Tidiane Dia) * Fix “Edit this page” missing from userbar (Satvik Vashisht) * Prevent audit log report from failing on missing models (Andy Chosak) * Add missing log information for `wagtail.schedule.cancel` (Stefan Hammer) * Fix timezone activation leaking into subsequent requests in `require_admin_access()` (Stefan Hammer) * Prevent matches from unrelated models from leaking into SQLite FTS searches (Matt Westcott) * Update Algolia DocSearch to use new application and correct versioning setup (Thibaud Colas) ### Documentation * Docs: Clarify `ClusterableModel` requirements for using relations with `RevisionMixin`-enabled models (Sage Abdullah) # 4.1.4.html.md # Wagtail 4.1.4 release notes *April 3, 2023* > * [What’s new](#what-s-new) ## What’s new ### CVE-2023-28836: Stored XSS attack via ModelAdmin views 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](https://github.com/wagtail/wagtail/security/advisories/GHSA-5286-f2rf-35c2). ### CVE-2023-28837: Denial-of-service via memory exhaustion when uploading large files 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](https://github.com/wagtail/wagtail/security/advisories/GHSA-33pv-vcgh-jfg9). ### Bug fixes * Fix radio and checkbox elements shrinking when using a long label (Sage Abdullah) * Fix select elements expanding beyond their container when using a long option label (Sage Abdullah) * Fix timezone handling of `TemplateResponse`s for users with a custom timezone (Stefan Hammer, Sage Abdullah) * Ensure TableBlock initialization correctly runs after load and its width is aligned with the parent panel (Dan Braghis) * Ensure that the JavaScript media files are loaded by default in Snippet index listings for date fields (Sage Abdullah) * Fix server-side caching of the icons sprite (Thibaud Colas) * Always show Add buttons, guide lines, Move up/down, Duplicate, Delete; in StreamField and Inline Panel (Thibaud Colas) * Ensure datetimepicker widget overlay shows over modals & drop-downs (LB (Ben) Johnston) ### Maintenance * Render large image renditions to disk (Jake Howard) # 4.1.5.html.md # Wagtail 4.1.5 release notes *May 2, 2023* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes * Prevent TableBlock from becoming uneditable after save (Sage Abdullah) # 4.1.6.html.md # Wagtail 4.1.6 release notes *May 25, 2023* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes * Rectify previous fix for TableBlock becoming uneditable after save (Sage Abdullah) * Ensure that copying page correctly picks up the latest revision (Matt Westcott) * Adjust collection field alignment in multi-upload forms (LB (Ben) Johnston) * Prevent lowercase conversions of IndexView column headers (Virag Jain) ### Documentation * Update documentation for `log_action` parameter on `RevisionMixin.save_revision` (Christer Jensen) # 4.1.7.html.md # Wagtail 4.1.7 release notes *September 27, 2023* > * [What’s new](#what-s-new) ## What’s new ### Maintenance * Relax Willow dependency to allow use of current Pillow versions with security fixes (Dan Braghis) # 4.1.8.html.md # Wagtail 4.1.8 release notes *September 28, 2023* > * [What’s new](#what-s-new) ## What’s new ### Maintenance * Additionally update Pillow dependency to allow use of versions with security fixes (Dan Braghis) # 4.1.9.html.md # Wagtail 4.1.9 release notes *October 19, 2023* > * [What’s new](#what-s-new) ## What’s new ### CVE-2023-45809: Disclosure of user names via admin bulk action views 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](https://github.com/wagtail/wagtail/security/advisories/GHSA-fc75-58r8-rm3h). # 4.1.html.md # Wagtail 4.1 (LTS) release notes *November 1, 2022* > * [What’s new](#what-s-new) > * [Upgrade considerations](#upgrade-considerations) Wagtail 4.1 is designated a Long Term Support (LTS) release. Long Term Support releases will continue to receive maintenance updates as necessary to address security and data-loss related issues, up until the next LTS release (typically a period of 12 months). ## What’s new ### “What’s New” dashboard banner and “Help” menu 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`](../reference/settings.md#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`](../reference/hooks.md#register-help-menu-item) – to add new items to the “Help” menu - [`construct_help_menu`](../reference/hooks.md#construct-help-menu) – to change or remove existing items from the “Help” menu - [`construct_main_menu`](../reference/hooks.md#construct-main-menu) – to remove the new “Help” menu altogether ### Page editor minimap When 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. ### New UI for scheduled publishing Scheduled publishing settings can now be found within the Status side panel of the page editing view. This change aims to improve clarity over who can set schedules, and when they take effect. This feature was developed by Sage Abdullah. ### Customizable snippet admin views The `register_snippet` function now accepts a `SnippetViewSet` class, allowing various aspects of the snippet’s admin views to be customized. See [Customizing admin views for snippets](../topics/snippets/customizing.md#wagtailsnippets-custom-admin-views). This feature was developed by Sage Abdullah. ### Scheduled publishing for snippets Snippet models that inherit from `DraftStateMixin` can now be assigned go-live and expiry dates. This feature was developed by Sage Abdullah. ### Object usage reporting Images, documents and snippets now provide a usage report, listing the places where references to those objects appear. This report is powered by a new `ReferenceIndex` model which records cross-references between objects whenever those objects to save; this allows it to work more efficiently than the old report available through the `WAGTAIL_USAGE_COUNT_ENABLED` setting, as well as handling references within StreamField and rich text fields. Note that on first upgrading to Wagtail 4.1, you will need to run the `rebuild_references_index` management command to populate the references table and ensure that reference counts are displayed accurately. By default, references are tracked for all models in the project, including ones not managed through Wagtail - to disable this for specific models, see [Manage the reference index](../advanced_topics/reference_index.md#managing-the-reference-index). This feature was developed by Karl Hobley and Matt Westcott. ### Documentation improvements There are multiple improvements to the documentation theme this release, here are some highlights. * Code snippets now have a quick copy to clipboard button (Mohammad Areeb) * Improve the dark mode theme adoption, avoid flashing the wrong theme on first load, reduce the need for scrollbars in page TOC, link underline fixes in Safari (LB (Ben) Johnston, Kartik Kankurte) * Better accessibility support with a skip to content link (LB (Ben) Johnston) ### Other features * Formalised support for Python 3.11 (Matt Westcott) * Add basic keyboard control and screen reader support for page listing re-ordering (Paarth Agarwal, Thomas van der Hoeven) * Add `PageQuerySet.private` method as an alias of `not_public` (Mehrdad Moradizadeh) * Most images in the admin will now only load once they are visible on screen (Jake Howard) * Allow setting default attributes on image tags [Adding default attributes to all images](../topics/images.md#adding-default-attributes-to-images) (Jake Howard) * Optimise the performance of the Wagtail userbar to remove duplicated queries, improving page loads when viewing live pages while signed in (Jake Howard) * Remove legacy styling classes for buttons and refactor button styles to be more maintainable (Paarth Agarwal, LB (Ben Johnston)) * Add button variations to the pattern library (Paarth Agarwal) * Provide a more accessible page title where the unique information is shown first and the CMS name is shown last (Mehrdad Moradizadeh) * Pull out behavior from `AbstractFormField` to `FormMixin` and `AbstractEmailForm` to `EmailFormMixin` to allow use with subclasses of `Page` [Using FormMixin or EmailFormMixin to use with other Page subclasses](../reference/contrib/forms/customization.md#form-builder-mixins) (Mehrdad Moradizadeh, Kurt Wall) * Add a `docs.wagtail.org/.well-known/security.txt` so that the security policy is available as per the specification on [https://securitytxt.org/](https://securitytxt.org/) (Jake Howard) * Add unit tests for the `classnames` Wagtail admin template tag (Mehrdad Moradizadeh) * Show an inverse locked indicator when the page has been locked by the current user in reports and dashboard listings (Vaibhav Shukla, LB (Ben Johnston)) * Add clarity to the development documentation that `admonition` should not be used and titles for `note` are not supported, including clean up of some existing incorrect usage (LB (Ben Johnston)) * Unify the styling of delete/destructive button styles across the admin interface (Paarth Agarwal) * Adopt new designs and unify the styling styles for `.button-secondary` buttons across the admin interface (Paarth Agarwal) * Refine designs for disabled buttons throughout the admin interface (Paarth Agarwal) * Update expanding formset add buttons to use `button` not link for behaviour and remove support for disabled as a class (LB (Ben) Johnston) * Add robust unit testing for authentication scenarios across the user management admin pages (Mehrdad Moradizadeh) * Avoid assuming an integer PK named ‘id’ on multiple upload views (Matt Westcott) * Add a toggle to collapse/expand all page panels at once (Helen Chapman) * Improve the GitHub Workflows (CI) security (Alex (sashashura)) * Use `search` type input in documentation search (LB (Ben) Johnston) * Render `help_text` when set on `FieldPanel`, `MultiFieldPanel`, `FieldRowPanel`, and other panel APIs where it previously worked without official support (Matt Westcott) * Consolidate usage of Excel libraries to a single library `openpyxl`, removing usage of `XlsxWriter`, `tablib`, `xlrd` and `xlwt` (Jaap Roes) * Adopt generic class based views for the create User create view, User edit view, user delete view and Users index listing / search results (Mehrdad Moradizadeh) * Add `button-secondary bicolor` variants to the pattern library and styleguide (Adinapunyo Banerjee) * Add better support for non-integer / non-`id` primary keys into Wagtail’s generic views, including for custom Snippets and User models (Mehrdad Moradizadeh) * Upgrade jQuery UI to version 1.13.2 (LB (Ben) Johnston) * Update pattern library background & text examples (Albina Starykova) * Switch StreamField blocks to use a `
    ` element so screen reader users can bypass them more easily (Thibaud Colas) * Add anchor links to StreamField blocks so users can navigate straight to a given block (Thibaud Colas) * Support “Ctrl + f” in-page search within collapsed StreamField blocks (Thibaud Colas) * Remember the last opened side panel in the page editor, activating it on page load (Sage Abdullah) * Ensure that the [`update_index`](../reference/management_commands.md#update-index) command can run without console output if called with `--verbosity 0` (Ben Sturmfels, Oliver Parker) * Improve side panels’ resizing in page editor and listings (Steven Steinwand) * Adjust breadcrumb text alignment and size in page listings & page editor (Steven Steinwand) * Improvements to getting started tutorial aimed at developers who are very new to Python and have no Django experience (Damilola Oladele) * The `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) * Add new test assertions to `WagtailPageTestCase` - `assertPageIsRoutable`, `assertPageIsRenderable`, `assertPageIsEditable`, `assertPageIsPreviewable` (Andy Babic) * Add documentation to the performance section about how to better create image URLs when not used directly on the page (Jake Howard) * Add ability to provide a required `permission` to `PanelGroup`, used by `TabbedInterface`, `ObjectList`, `FieldRowPanel` and `MultiFieldPanel` (Oliver Parker) * Update documentation screenshots of the admin interface to align with changes in this release (Thibaud Colas) ### Bug fixes * Prevent `PageQuerySet.not_public` from returning all pages when no page restrictions exist (Mehrdad Moradizadeh) * Ensure that duplicate block ids are unique when duplicating stream blocks in the page editor (Joshua Munn) * Revise color usage so that privacy & locked indicators can be seen in Windows High Contrast mode (LB (Ben Johnston)) * Ensure that disabled buttons have a consistent presentation on hover to indicate no interaction is available (Paarth Agarwal) * Update the ‘Locked pages’ report menu title so that it is consistent with other pages reports and its own title on viewing (Nicholas Johnson) * Support `formfield_callback` handling on `ModelForm.Meta` for future Django 4.2 release (Matt Westcott) * Ensure that `ModelAdmin` correctly supports filters in combination with subsequent searches without clearing the applied filters (Stefan Hammer) * Add missing translated values to site settings’ headers plus models presented in listings and audit report filtering labels (Stefan Hammer) * Remove `capitalize()` calls to avoid issues with other languages or incorrectly presented model names for reporting and parts of site settings (Stefan Hammer) * Add back rendering of `help_text` for InlinePanel (Matt Westcott) * Ensure `for_user` argument is passed to the form class when previewing pages (Matt Westcott) * Ensure the capitalization of the `timesince_simple` tag is consistently added in the template based on usage in context (Stefan Hammer) * Add missing translation usage for the `timesince_last_update` and ensure the translated labels can be easier to work with in Transifex (Stefan Hammer) * Add additional checks for duplicate form field `clean_name` values in the Form Builder validation and increase performance of checks (Dan Bentley) * Use correct color for labels of radio and checkbox fields (Steven Steinwand) * Adjust spacing of fields’ error messages and position in tables (Steven Steinwand) * Update dead or redirected links throughout the documentation (LB (Ben) Johnston) * Use different icons for workflow timeline component, so the steps can be distinguished with other means than color (Sam Moran) * Use the correct custom font for the Wagtail userbar (Umar Farouk Yunusa) * StreamField blocks are now collapsible with the keyboard (Thibaud Colas) * StreamField block headings now have a label for screen reader users (Thibaud Colas) * Display the “\*” required field indicator for StreamField blocks (Thibaud Colas) * Resolve inconsistency in action button positions in InlinePanel (Thibaud Colas) * Use h3 elements with a counter in InlinePanel so screen reader users can navigate by heading (Thibaud Colas) * Ensure that buttons on custom chooser widgets are correctly shown on hover (Thibaud Colas) * Add missing asterisk to title field placeholder (Seremba Patrick, Stefan Hammer) * Avoid creating an extra rich text block when inserting a new block at the end of the content (Matt Westcott) * Removed the extra dot in the Wagtail version shown within the admin settings menu item (Loveth Omokaro) * Fully remove the obsolete `wagtailsearch_editorspick` table that prevents flushing the database (Matt Westcott) * Update latest version message on Dashboard to accept dev build version format used on nlightly builds (Sam Moran) * Ensure `ChooserBlock.extract_references` uses the model class, not the model string (Alex Tomkins) * Regression in field width for authentication pages (log in / password reset) (Chisom Okeoma) * Ensure the new minimap correctly pluralizes error counts for `aria-label`s (Matt Westcott) ## Upgrade considerations ### `rebuild_references_index` management command After 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 [Manage the reference index](../advanced_topics/reference_index.md#managing-the-reference-index). ### Recommend `WagtailPageTestCase` in place of `WagtailPageTests` * `WagtailPageTestCase` is the base testing class and is now recommended over using `WagtailPageTests` [Testing your Wagtail site](../advanced_topics/testing.md#testing-reference). * `WagtailPageTests` will continue to work and does log in the user on test `setUp` but may be deprecated in the future. ```python # 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): # ... ``` ### Button styling class changes The `button-secondary` class is no longer compatible with either the `.serious` or `.no` classes, this partially worked previously but is no longer officially supported. When adding custom buttons using the `ModelAdmin` `ButtonHelper` class, custom buttons will no longer include the `button-secondary` class by default in index listings. If using the hook `register_user_listing_buttons` to register buttons along with the undocumented `UserListingButton` class, the `button-secondary` class will no longer be included by default. Avoid using `disabled` as a class on `button` elements, instead use the [`disabled` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/disabled) as support for this as a class may be removed in a future version of Wagtail and is not accessible. If using custom `expanding-formset` the add button will no longer support the `disabled` class but instead must require the `disabled` attribute to be set. The following button classes have been removed, none of which were being used within the admin but may have been used by custom code or packages: * `button-neutral` * `button-strokeonhover` * `hover-no` * `unbutton` * `yes` ### Dropped support for importing `.xls` Spreadsheet files into Redirects * `.xls` legacy Microsoft Excel 97-2003 spreadsheets will no longer be supported for importing into the contrib Redirects listing. * `.xlsx`, `.csv`, `.tsv` formats are still supported. # 4.2.1.html.md # Wagtail 4.2.1 release notes *March 13, 2023* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes * Support creating `StructValue` copies (Tidiane Dia) * Fix image uploads on storage backends that require file pointer to be at the start of the file (Matt Westcott) * Fix “Edit this page” missing from userbar (Satvik Vashisht) * Prevent audit log report from failing on missing models (Andy Chosak) * Fix page/snippet cannot proceed a `GroupApprovalTask` if it’s locked by someone outside of the group (Sage Abdullah) * Add missing log information for `wagtail.schedule.cancel` (Stefan Hammer) * Fix timezone activation leaking into subsequent requests in `require_admin_access()` (Stefan Hammer) * Fix dialog component’s message to have rounded corners at the top side (Sam) * Prevent matches from unrelated models from leaking into SQLite FTS searches (Matt Westcott) * Prevent duplicate addition of StreamField blocks with the new block picker (Deepam Priyadarshi) * Update Algolia DocSearch to use new application and correct versioning setup (Thibaud Colas) ### Documentation * Docs: Clarify `ClusterableModel` requirements for using relations with `RevisionMixin`-enabled models (Sage Abdullah) # 4.2.2.html.md # Wagtail 4.2.2 release notes *April 3, 2023* > * [What’s new](#what-s-new) ## What’s new ### CVE-2023-28836: Stored XSS attack via ModelAdmin views 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](https://github.com/wagtail/wagtail/security/advisories/GHSA-5286-f2rf-35c2). ### CVE-2023-28837: Denial-of-service via memory exhaustion when uploading large files 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](https://github.com/wagtail/wagtail/security/advisories/GHSA-33pv-vcgh-jfg9). ### Bug fixes * Fix radio and checkbox elements shrinking when using a long label (Sage Abdullah) * Fix select elements expanding beyond their container when using a long option label (Sage Abdullah) * Fix timezone handling of `TemplateResponse`s for users with a custom timezone (Stefan Hammer, Sage Abdullah) * Ensure TableBlock initialization correctly runs after load and its width is aligned with the parent panel (Dan Braghis) * Ensure that the JavaScript media files are loaded by default in Snippet index listings for date fields (Sage Abdullah) * Fix server-side caching of the icons sprite (Thibaud Colas) * Avoid showing scrollbars in the block picker unless necessary (Babitha Kumari) * Always show Add buttons, guide lines, Move up/down, Duplicate, Delete; in StreamField and Inline Panel (Thibaud Colas) * Ensure datetimepicker widget overlay shows over modals & drop-downs (LB (Ben) Johnston) ### Documentation * Fix module path for `MultipleChooserPanel` in panel reference docs ### Maintenance * Render large image renditions to disk (Jake Howard) # 4.2.3.html.md # Wagtail 4.2.3 release notes *May 2, 2023* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes * Prevent TableBlock from becoming uneditable after save (Sage Abdullah) # 4.2.4.html.md # Wagtail 4.2.4 release notes *May 25, 2023* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes * Rectify previous fix for TableBlock becoming uneditable after save (Sage Abdullah) * Ensure that copying page correctly picks up the latest revision (Matt Westcott) * Adjust collection field alignment in multi-upload forms (LB (Ben) Johnston) * Prevent lowercase conversions of IndexView column headers (Virag Jain) ### Documentation * Update documentation for `log_action` parameter on `RevisionMixin.save_revision` (Christer Jensen) # 4.2.html.md # Wagtail 4.2 release notes *February 6, 2023* > * [What’s new](#what-s-new) > * [Upgrade considerations](#upgrade-considerations) ## What’s new ### StreamField data migration helpers Wagtail now provides a set of utilities for creating data migrations on StreamField data. For more information, see [StreamField data migrations](../advanced_topics/streamfield_migrations.md#streamfield-data-migrations). This feature was developed by Sandil Ranasinghe, initially as the [wagtail-streamfield-migration-toolkit](https://github.com/wagtail/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. ### Locking for snippets Snippets can now be locked by users to prevent other users from editing, through the use of the `LockableMixin`. For more details, see [Locking snippets](../topics/snippets/features.md#wagtailsnippets-locking-snippets). This feature was developed by Sage Abdullah. ### Workflows for snippets 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 [Enabling workflows for snippets](../topics/snippets/features.md#wagtailsnippets-enabling-workflows). This feature was developed by Sage Abdullah. ### `fullpageurl` template tag Wagtail 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 [fullpageurl](../topics/writing_templates.md#fullpageurl-tag). This feature was developed by Jake Howard. ### CSP compatibility & Stimulus adoption Wagtail now uses the Stimulus framework for client-side interactivity (see [RFC 78](https://github.com/wagtail/rfcs/pull/78)). Our [Outreachy contributor](https://wagtail.org/blog/our-very-first-outreachy-interns/) Loveth Omokaro has refactored significant portions of the admin interface: * The Skip Link component displayed on all pages. * The dashboard’s Upgrade notification message. * Auto-submitting of listing filters. * Loading of Wagtail’s icon sprite * Page lock/unlock actions * Workflow enable actions 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. ### Accessibility checker integration The CMS now includes an accessibility checker in the [user bar](../topics/writing_templates.md#wagtailuserbar-tag), to assist users in building more accessible websites and follow [ATAG 2.0 guidelines](https://www.w3.org/TR/ATAG20/). 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`](../reference/hooks.md#construct-wagtail-userbar) hook. This new feature was implemented by Albina Starykova as part of an [Outreachy internship](https://wagtail.org/blog/our-very-first-outreachy-interns/), with support from mentors Thibaud Colas, Sage Abdullah, and Joshua Munn. ### Rich text improvements Following feedback from Wagtail users on [rich text UI improvements in Wagtail 4.0](4.0.md#rich-text-improvements-4), we have further refined the behavior of rich text fields to cater for different scenarios: * Users can now choose between an “inline” floating toolbar, and a fixed toolbar at the top of the editor. Both toolbars display all formatting options. * The ‘/’ command palette and block picker in rich text fields now contain all formatting options except text styles. * The ‘/’ command palette and block picker are now always available no matter where the cursor is placed, to support inserting content at any point within text, transforming existing content, and splitting StreamField blocks in the middle of a paragraph when needed. * The block picker interface now displays two columns so more options are visible without scrolling. Thank you to all who provided feedback, participants to our usability testing sessions, and to Nick Lee and Thibaud Colas for the implementation. ### Multiple chooser panel A new panel type [MultipleChooserPanel](../reference/panels.md#multiple-chooser-panel) 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](https://yougov.com/). ### Other features * Test assertion [`WagtailPageTestCase.assertCanCreate`](../advanced_topics/testing.md#testing-reference) now supports the kwarg `publish=True` to determine whether to publish the page (Harry Percival, Akua Dokua Asiedu, Matt Westcott) * Ensure that the `rebuild_references_index` command can run without console output if called with `--verbosity 0` (Omerzahid Ali, Aman Pandey) * Add full support for secondary buttons with icons in the Wagtail design system - `button bicolor button--icon button-secondary` including the `button-small` variant (Seremba Patrick) * Add [`purge_embeds`](../reference/management_commands.md#purge-embeds) management command to delete all the cached embed objects in the database (Aman Pandey) * Make it possible to resize the page editor’s side panels (Sage Abdullah) * Add ability to include [`form_fields` as an APIField](../advanced_topics/api/v2/configuration.md#form-page-fields-api-field) on `FormPage` (Sævar Öfjörð Magnússon, Suyash Singh, LB (Ben) Johnston) * Ensure that images listings are more consistently aligned when there are fewer images uploaded (Theresa Okoro) * Add more informative validation error messages for non-unique slugs within the admin interface and for programmatic page creation (Benjamin Bach) * Always show the page editor title field’s border when the field is empty (Thibaud Colas) * Snippet models extending `DraftStateMixin` now automatically define a “Publish” permission type (Sage Abdullah) * Users now remain on the edit page after saving a snippet as draft (Sage Abdullah) * Base project template now populates the meta description tag from the search description field (Aman Pandey) * Added support for `azure-mgmt-cdn` version >= 10 and `azure-mgmt-frontdoor` version >= 1 in the frontend cache invalidator (Sylvain Fankhauser) * Add a system check to warn when a `django-storages` backend is configured to allow overwriting (Rishabh Jain) * Update admin focus outline color to have higher contrast against white backgrounds (Thibaud Colas) * Implement latest design for the admin dashboard header (Thibaud Colas, Steven Steinwand) * Restyle the userbar to follow the visual design of the Wagtail admin (Albina Starykova) * Adjust the size of panel labels on the “Account” form (Thibaud Colas) * Delay hiding the contents of the side panels when closing, so the animation is smoother (Thibaud Colas) * ListBlock now shows item-by-item differences when comparing versions (Tidiane Dia) * Switch StreamField blocks to use the same picker interface as within rich text fields (Thibaud Colas) ### Bug fixes * Make sure workflow timeline icons are visible in high-contrast mode (Loveth Omokaro) * Ensure authentication forms (login, password reset) have a visible border in Windows high-contrast mode (Loveth Omokaro) * Ensure visual consistency between buttons and links as buttons in Windows high-contrast mode (Albina Starykova) * Ensure `ChooserBlock.extract_references` uses the model class, not the model string (Alex Tomkins) * Incorrectly formatted link in the documentation for Wagtail community support (Bolarinwa Comfort Ajayi) * Ensure logo shows correctly on log in page in Windows high-contrast mode (Loveth Omokaro) * Comments notice background overflows its container (Yekasumah) * Ensure links within help blocks meet color contrast guidelines for accessibility (Theresa Okoro) * Ensure the skip link (used for keyboard control) meets color contrast guidelines for accessibility (Dauda Yusuf) * Ensure tag fields correctly show in both dark and light Windows high-contrast modes (Albina Starykova) * Ensure new tooltips & tooltip menus have visible borders and tip triangle in Windows high-contrast mode (Juliet Adeboye) * Ensure there is a visual difference of ‘active/current link’ vs normal links in Windows high-contrast mode (Mohammad Areeb) * Avoid issues where trailing whitespace could be accidentally removed in translations for new page & snippet headers (Florian Vogt) * Make sure minimap error indicators follow the minimap scrolling (Thibaud Colas) * Remove the ability to view or add comments to `InlinePanel` inner fields to avoid lost or incorrectly linked comments (Jacob Topp-Mugglestone) * Use consistent heading styles on top-level fields in the page editor (Sage Abdullah) * Allow button labels to wrap onto two lines in dropdown buttons (Coen van der Kamp) * Remove spurious horizontal resize handle from text areas (Matt Westcott) * Move DateField, DateTimeField, TimeField comment buttons to be right next to the fields (Theresa Okoro) * Support text resizing in workflow steps cards (Ivy Jeptoo) * Ignore images added via fixtures when using `WAGTAILIMAGES_FEATURE_DETECTION_ENABLED` to avoid errors for images that do not exist (Aman Pandey) * Restore ability to perform JSONField query operations against StreamField when running against the Django 4.2 development branch (Sage Abdullah) * Ensure there is correct grammar and pluralization for Tab error counts shown to screen readers (Aman Pandey) * Pass through expected `cc`, `bcc` and `reply_to` to the Django mail helper from `wagtail.admin.mail.send_mail` (Ben Gosney) * Allow reviewing or reverting to a Page’s initial revision (Andy Chosak) * Use the correct padding for autocomplete block picker (Umar Farouk Yunusa) * Ensure that short content pages (such as editing snippets) do not show an inconsistent background (Sage Abdullah) * Fix horizontal positioning of rich text inline toolbar (Thibaud Colas) * Ensure that `DecimalBlock` correctly handles `None`, when `required=False`, values (Natarajan Balaji) * Close the userbar when clicking its toggle (Albina Starykova) * Add a border around the userbar menu in Windows high-contrast mode so it can be identified (Albina Starykova) * Make sure browser font resizing applies to the userbar (Albina Starykova) * Fix check for `delete_url_name` attribute in generic `DeleteView` (Alex Simpson) * Re-implement design system colors so HSL values exactly match the desired RGB (Albina Starykova) * Resolve issue where workflow and other notification emails would not include the correct tab URL for account notification management (LB (Ben) Johnston) * Use consistent spacing above and below page headers (Thibaud Colas) * Use the correct icon sizes and spacing in slim header (Thibaud Colas) * Use the correct color for placeholders in rich text fields (Thibaud Colas) * Prevent obstructing the outline around rich text fields (Thibaud Colas) * Page editor dropdowns now use indigo backgrounds like elsewhere in the admin interface (Thibaud Colas) * Allow parsing of multiple key/value pairs from string in `wagtail.search.utils.parse_query_string` (Beniamin Bucur) * Prevent memory exhaustion when purging a large number of revisions (Jake Howard) * Add right-to-left (RTL) support for the following form components: Switch, Minimap, live preview (Thibaud Colas) * Improve right-to-left (RTL) positioning for the following components: Page explorer, Sidebar sub-menu, rich text tooltips, rich text toolbar trigger, editor section headers (Thibaud Colas) * Center-align StreamField and rich text block picker buttons with the dotted guide line (Thibaud Colas) * Search bar in chooser modals now performs autocomplete searches under PostgreSQL (Matt Westcott) * Server-side document filenames are preserved when replacing a document file (Suyash Singh, Matt Westcott) * Do not show bulk actions checkbox in page type usage view (Sage Abdullah) * Prevent account name from overflowing the sidebar (Aman Pandey) * Ensure edit form is displayed as unlocked immediately after canceling a workflow (Sage Abdullah) * Prevent `latest_revision` pointer from being copied over when copying translatable snippets for translation (Sage Abdullah) ### Documentation * Wagtail’s documentation (v2.9 to v4.0) has been updated on [Dash user contributions](https://github.com/Kapeli/Dash-User-Contributions) for [Dash](https://kapeli.com/dash) or [Zeal](https://zealdocs.org/) offline docs applications (Damilola Oladele, Mary Ayobami, Elizabeth Bassey) * Wagtail’s documentation (v2 to v4.0) has been added to [DevDocs](https://devdocs.io/wagtail/) which has offline support and is easily accessible in any browser (Vallabh Tiwari) * Add custom permissions section to permissions documentation page (Dan Hayden) * Add documentation for how to get started with [contributing translations](../contributing/translations.md#contributing-translations) for the Wagtail admin (Ogunbanjo Oluwadamilare) * Officially recommend `fnm` over `nvm` in development documentation (LB (Ben) Johnston) * Mention the importance of passing `request` and `current_site` to `get_url` on the [performance](../advanced_topics/performance.md#performance-overview) documentation page (Jake Howard) * Add documentation for [`register_user_listing_buttons`](../reference/hooks.md#register-user-listing-buttons) hook (LB (Ben Johnston)) * Add development (contributing to Wagtail) documentation notes for [development on Windows](../contributing/developing.md#development-on-windows) (Akua Dokua Asiedu) * Mention Wagtail’s usage of Django’s default user model by default (Temidayo Azeez) * Add links to treebeard documentation for relevant methods (Temidayo Azeez) * Add clarification on where to register entity plugins (Mark McOsker) * Fix logo in README not being visible in high-contrast mode (Benita Anawonah) * Improve ‘first wagtail site’ tutorial (Akua Dokua Asiedu) * Grammatical adjustments of `page models` usage guide (Damilola Oladele) * Add class inheritance information to StreamField block reference (Temidayo Azeez) * Document the hook [`register_image_operations`](../reference/hooks.md#register-image-operations) and add an example of a [custom Image filter](../extending/custom_image_filters.md#custom-image-filters) (Coen van der Kamp) * Fix incorrect example code for StreamField migration of `RichTextField` (Matt Westcott) * Document the policy needed to create invalidations in CloudFront (Jake Howard) * Document how to add permission restriction to a report view (Rishabh jain) * Add example for how to configure API `renderer_classes` (Aman Pandey) * Document potential data loss for BaseLogEntry migration in 3.0 (Sage Abdullah) * Add documentation for the reference index mechanism (Daniel Kirkham) ### Maintenance * Switch to using [Willow](https://github.com/wagtail/Willow/) instead of Pillow for images (Darrel O’Pry) * Remove unsquashed `testapp` migrations (Matt Westcott) * Upgrade to Node 18 for frontend build tooling (LB (Ben) Johnston) * Run Python tests with coverage and upload coverage data to codecov (Sage Abdullah) * Clean up duplicate JavaScript for the `escapeHtml` function (Jordan Rob) * Ensure that translation file generation ignores JavaScript unit tests and clean up unit tests for Django gettext utils (LB (Ben Johnston)) * Migrated `initButtonSelects` from core.js to own TypeScript file and add unit tests (Loveth Omokaro) * Migrated `initSkipLink` util to TypeScript and add JSDoc & unit tests (Juliet Adeboye) * Clean up some unused utility classes and migrate `unlist` to Tailwind utility class `w-list-none` (Loveth Omokaro) * Clean up linting on legacy code and add shared util `hasOwn` in TypeScript (Loveth Omokaro) * Remove unnecessary box-sizing: border-box declarations in SCSS (Albina Starykova) * Migrated `initTooltips` to TypeScript and add JSDoc and unit tests (Fatuma Abdullahi) * Migrated `initTagField` from core.js to own TypeScript file and add unit tests (Chisom Okeoma) * Added unit tests & JSDoc to `initDismissibles` (Yekasumah) * Standardise on `classname` for passing HTML class attributes (LB (Ben Johnston)) * Clean up expanding formset and `InlinePanel` JavaScript initialization code and adopt a class approach (Matt Westcott) * Extracted revision and draft state logic from generic views into mixins (Sage Abdullah) * Extracted generic lock / unlock views from page lock / unlock views (Sage Abdullah) * Move `identity` JavaScript util into shared utils folder (LB (Ben Johnston)) * Remove unnecessary declaration of function to determine URL query params, instead use `URLSearchParams` (Loveth Omokaro) * Update `tsconfig` to better support modern TypeScript development and clean up some code quality issues via Eslint (Loveth Omokaro) * Switch userbar to initialize a Web Component to avoid styling clashes (Albina Starykova) * Refactor userbar stylesheets to use the same CSS loading as the rest of the admin (Albina Starykova) * Remove unused search-bar and button-filter styles (Thibaud Colas) * Use util method to construct dummy requests in tests (Jake Howard) * Remove unused dev-only react-axe integration (Thibaud Colas) * Split up `wagtail.admin.panels` into submodules, existing exports have been preserved (Matt Westcott) * Refactor userbar styles to use the same stylesheet as other components (Thibaud Colas) * Add deprecation warnings for `wagtail.core` and other imports deprecated in Wagtail 3.0 (Matt Westcott) * Upgraded Transifex configuration to v3 (Loic Teixeira) * Replace repeated HTML `avatar` component with a template tag include `{% avatar ... %}` throughout the admin interface (Aman Pandey) * Refactor accessibility checker userbar item (Albina Starykova) ## Upgrade considerations ### Wagtail-specific image field (`WagtailImageField`) The `AbstractImage` and `AbstractRendition` models use a Wagtail-specific `WagtailImageField` which extends Django’s `ImageField` to use [Willow](https://github.com/wagtail/Willow/) for image file handling. This will generate a new migration if you are using a [custom image model](../advanced_topics/images/custom_image_model.md#custom-image-model). ### Comments within `InlinePanel` not supported When 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. ### Adoption of `classname` convention for some template tags & includes Some 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 class The (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_LOCK` The `WAGTAILADMIN_GLOBAL_PAGE_EDIT_LOCK` setting has been renamed to [`WAGTAILADMIN_GLOBAL_EDIT_LOCK`](../reference/settings.md#wagtailadmin-global-edit-lock). ### Wagtail userbar as a web component The [`wagtailuserbar`](../topics/writing_templates.md#wagtailuserbar-tag) template tag now initializes the userbar as a [Web Component](https://developer.mozilla.org/en-US/docs/Web/Web_Components), 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: ```css wagtail-userbar::part(userbar) { bottom: 30px; } ``` ### Configuration of the accessibility checker user bar item Like other userbar items, the new accessibility checker is configurable with the [`construct_wagtail_userbar`](../reference/hooks.md#construct-wagtail-userbar) hook. For example, to remove the new item, use: ```python 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)] ``` ### Support for legacy versions of `azure-mgmt-cdn` and `azure-mgmt-frontdoor` packages will be dropped If 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: * For Azure CDN: upgrade `azure-mgmt-cdn` to version 10 or above * For Azure Front Door: upgrade `azure-mgmt-frontdoor` to version 1 or above Support for older versions will be dropped in a future release. ### Changes to `Workflow` and `Task` methods To accommodate workflows support for snippets, the `page` parameter in [`Workflow.start()`](../reference/models.md#wagtail.models.Workflow.start) has been renamed to `obj`. In addition, some methods on the base [`Task`](../reference/models.md#wagtail.models.Task) model have been changed. If you have [custom Task types](../extending/custom_tasks.md), make sure to update the methods to reflect the following changes: - `page_locked_for_user()` is now [`locked_for_user()`](../reference/models.md#wagtail.models.Task.locked_for_user). Using `page_locked_for_user()` is deprecated and will be removed in a future release. - The `page` parameter in `user_can_access_editor()`, `locked_for_user()`, `user_can_lock()`, `user_can_unlock()`, `get_actions()`, has been renamed to `obj`. ### Changes to `WorkflowState` and `TaskState` models To 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 logic The `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. # 5.0.1.html.md # Wagtail 5.0.1 release notes *May 25, 2023* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes * Rectify previous fix for TableBlock becoming uneditable after save (Sage Abdullah) * Ensure that copying page correctly picks up the latest revision (Matt Westcott) * Ensure comment buttons always respect `WAGTAILADMIN_COMMENTS_ENABLED` (Thibaud Colas) * Fix error when deleting a single snippet through the bulk actions interface (Sage Abdullah) * Pass the correct `for_update` value for `get_form_class` in `SnippetViewSet` edit views (Sage Abdullah) * Move comment notifications toggle to the comments side panel (Sage Abdullah) * Remove comment button on InlinePanel fields (Sage Abdullah) * Fix missing link to `UsageView` from `EditView` for snippets (Christer Jensen) * Prevent lowercase conversions of IndexView column headers (Virag Jain) * Fix various color issues in dark mode (Thibaud Colas) ### Documentation * Update documentation for `log_action` parameter on `RevisionMixin.save_revision` (Christer Jensen) # 5.0.2.html.md # Wagtail 5.0.2 release notes *June 21, 2023* > * [What’s new](#what-s-new) > * [Upgrade considerations](#upgrade-considerations) ## What’s new ### New features * Added [TitleFieldPanel](../reference/panels.md#title-field-panel) to support title / slug field synchronization (LB (Ben) Johnston) ### Bug fixes * Prevent JS error when reverting the spinner on a submit button after a validation error (LB (Ben) Johnston) * Prevent crash when comparing page revisions that include `MultipleChooserPanel` (Matt Westcott) * Ensure that title and slug continue syncing after entering non-URL-safe characters (LB (Ben) Johnston) * Ensure that title and slug are synced on keypress, not just on blur (LB (Ben) Johnston) * Add a more visible active state for side panel toggle buttons (Thibaud Colas) * Use custom dark theme colors for revision comparisons (Thibaud Colas) ## Upgrade considerations ### Use of `TitleFieldPanel` for the page title field This release introduces a new [TitleFieldPanel](../reference/panels.md#title-field-panel) class, which is used by default for the page title field and provides the mechanism for synchronizing the slug field with the title. Before Wagtail 5.0, this happened automatically on any field named ‘title’. If you have used `FieldPanel("title")` directly in a panel definition (rather than extending `Page.content_panels` as standard), and wish to restore the previous behavior of auto-populating the slug, you will need to change this to `TitleFieldPanel("title")`. For example: ```python from wagtail.admin.panels import FieldPanel, MultiFieldPanel # ... content_panels = [ MultiFieldPanel([ FieldPanel("title"), FieldPanel("subtitle"), ]), ] ``` should become: ```python from wagtail.admin.panels import FieldPanel, MultiFieldPanel, TitleFieldPanel # ... content_panels = [ MultiFieldPanel([ TitleFieldPanel("title"), FieldPanel("subtitle"), ]), ] ``` # 5.0.3.html.md # Wagtail 5.0.3 release notes *September 25, 2023* > * [What’s new](#what-s-new) ## What’s new ### Bug fixes * Avoid use of `ignore_conflicts` when creating extra permissions for snippets, for SQL Server compatibility (Sage Abdullah) * Ensure sequence on `wagtailsearchpromotions_query` table is correctly set after migrating data (Jake Howard) * Update Pillow dependency to 9.1.0 (Daniel Kirkham) # 5.0.4.html.md # Wagtail 5.0.4 release notes *October 4, 2023* > * [What’s new](#what-s-new) ## What’s new ### Maintenance * Relax Willow / Pillow dependency to allow use of current Pillow versions with security fixes (Dan Braghis) # 5.0.5.html.md # Wagtail 5.0.5 release notes *October 19, 2023* > * [What’s new](#what-s-new) ## What’s new ### CVE-2023-45809: Disclosure of user names via admin bulk action views 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](https://github.com/wagtail/wagtail/security/advisories/GHSA-fc75-58r8-rm3h). # 5.0.html.md # Wagtail 5.0 release notes *May 2, 2023* > * [What’s new](#what-s-new) > * [Upgrade considerations](#upgrade-considerations) ## What’s new ### Django 4.2 support This release adds support for Django 4.2. ### Object usage information on deleting objects On deleting a page, image, document or snippet, the confirmation screen now provides a summary of where the object is used, allowing users to see the effect that deletion will have elsewhere on the site. This also prevents objects from being deleted in cases where deletion would be blocked by an `on_delete=PROTECT` constraint. This feature was developed by Sage Abdullah. ### SVG image support The image library can now be configured to allow uploading SVG images. These are handled by the `{% image %}` template tag as normal, with some limitations on image operations - for full details, see [SVG images](../topics/images.md#svg-images). This feature was developed by Joshua Munn, and sponsored by [YouGov](https://yougov.com/). ### Custom validation support for StreamField Support for adding custom validation logic to StreamField blocks has been formalized and simplified. For most purposes, raising a `ValidationError` from the block’s `clean` method is now sufficient; more complex behaviors (such as attaching errors to a specific child block) are possible through block-specific subclasses of `ValidationError`. For more details, see [StreamField validation](../advanced_topics/streamfield_validation.md#streamfield-validation). This feature was developed by Matt Westcott. ### Customizable SVG icons Wagtail’s icon set is now fully updated, customizable, and extendable. Built-in icons are now based on the latest [FontAwesome](https://fontawesome.com/) visuals, with capabilities to both customize existing icons as well as add new ones. In particular, this includes: * A new `{% icon %}` icon template tag to reuse icons in custom templates. * A `register_icons` hook to register new icons and override existing ones. * Live documentation of all available icons in the styleguide, showcasing the icons available on the current site. * A list of [all built-in icons](../advanced_topics/icons.md#icons) within our developer documentation. * Support for customizing icons for snippets via `SnippetViewSet.icon`. * Support for custom panel icons, with defaults, displayed for top-level editor panels. * New icons for StreamField blocks For more details, see our new [icons documentation](../advanced_topics/icons.md#icons). This has been made possible thanks to a multi-year refactoring effort to migrate all icons to SVG. Thank you to all contributors who participated in this effort: Coen van der Kamp, LB (Ben) Johnston, Dan Braghis, Daniel Kirkham, Sage Abdullah, Thibaud Colas, Scott Cranfill, Storm Heg, Steve Steinwand, Jérôme Lebleu, Abayomi Victory. ### Accessibility checker improvements The [built-in accessibility checker](../advanced_topics/accessibility_considerations.md#authoring-accessible-content) has been updated with: * 5 more Axe rules enabled by default. * Sorting of checker results according to their position on the page. * Highlight styles to more easily identify elements with errors. * Configuration APIs in [`AccessibilityItem`](../advanced_topics/accessibility_considerations.md#wagtail.admin.userbar.AccessibilityItem) for simpler customization of the checks performed. Those improvements were implemented by Albina Starykova as part of an [Outreachy internship](https://wagtail.org/blog/introducing-wagtails-new-accessibility-checker/), with support from mentors Thibaud Colas, Sage Abdullah, and Joshua Munn. ### Always-on minimap Following its introduction in Wagtail 4.1, we have made several improvements to the page editor minimap: * It now stays opened until dismissed, so users can keep it expanded if desired. * Its “expanded” state is preserved when navigating between different views of the CMS. * The minimap and “Collapse all” button now appear next to side panels rather than underneath, so they can be used at any time. * Clicking any item reveals the minimap, with appropriate text for screen reader users. * Navigating to a collapsed section of the page will reveal this section. Thank you to everyone who provided feedback on this new addition to the editor experience. Those changes were implemented by Thibaud Colas. ### Dark mode Wagtail’s admin interface now supports dark mode. The new dark theme can be enabled in account preferences, as well as configuring permanent usage of the light theme, or following system preferences. We hope this new theme will bring accessibility improvements for users who prefer light text on dark backgrounds, and energy usage efficiency improvements for users of OLED monitors. This feature was developed by Thibaud Colas, with designs from Ben Enright. ### Snippets parity with ModelAdmin Continuing on recent improvements to snippets, we have made the following additions to how snippets can be customized in the admin interface: * Allow customizing the base URL and URL namespace for snippet views. * Allow customizing the default ordering and number of items per page for snippet listing views. * Allow admin templates for snippets to be overridden on a per-model or per-app basis. * Allow overriding the base queryset to be used in snippet `IndexView`. * Allow customizing the `search_fields` and search backend via SnippetViewSet. * Allow filters on snippet index views to be customized through the `list_filter` attribute. * Allow `panels` / `edit_handler` to be specified via `SnippetViewSet`. * Support for customizing icons for snippets via `SnippetViewSet.icon`. * Allow snippets to be registered into arbitrary admin menu items. For more details, see [Customizing admin views for snippets](../topics/snippets/customizing.md#wagtailsnippets-custom-admin-views). Developed by Sage Abdullah, these features were implemented as part of [RFC 85: Snippets parity with ModelAdmin](https://github.com/wagtail/rfcs/pull/85). We will start the deprecation process of the ModelAdmin contrib package in the next feature release and publish it as a separate package for users who wish to continue using it. The ModelAdmin package will be removed in Wagtail 6.0. ### Other features * Add `WAGTAILIMAGES_EXTENSIONS` setting to restrict image uploads to specific file types (Aman Pandey, Ananjan-R) * Update user list column level to `Access level` to be easier to understand (Vallabh Tiwari) * Migrate `.button-longrunning` behavior to a Stimulus controller with support for custom label element & duration (Loveth Omokaro) * Implement new simplified userbar designs (Albina Starykova) * Add usage view for pages (Sage Abdullah) * Copy page form now updates the slug field dynamically with a slugified value on blur (Loveth Omokaro) * Ensure selected collection is kept when navigating from documents or images listings to add multiple views & upon upload (Aman Pandey, Bojan Mihelac) * Keep applied filters when downloading form submissions (Suyash Srivastava) * Messages added dynamically via JavaScript now have an icon to be consistent with those supplied in the page’s HTML (Aman Pandey) * Switch lock/unlock side panel toggle to a switch, with more appropriate confirmation message status (Sage Abdullah) * Ensure that changed or cleared selection from choosers will dispatch a DOM `change` event (George Sakkis) * Add the ability to [disable model indexing](../topics/search/indexing.md#wagtailsearch-disable-indexing) by setting `search_fields = []` (Daniel Kirkham) * Enhance `wagtail.search.utils.parse_query_string` to allow inner single quotes for key/value parsing (Aman Pandey) * Add helpful properties to [`Locale`](../reference/models.md#locale-model-ref) for more convenient usage within templates, see [Basic example](../advanced_topics/i18n.md#i18n-basic-example) (Andy Babic) * Re-label “StreamField blocks” option in block picker to “Blocks” (Thibaud Colas) * Switch styleguide navigation to use panel components and minimap (Thibaud Colas) * Explicitly specify `MenuItem.name` for Snippets, Reports, and Settings menu items (Sage Abdullah) * Move the help text of fields and blocks directly below their label for easier reading (Thibaud Colas) * The select all checkbox in simple translation’s submit translation page will now be in sync with other checkbox changes (Hanoon) * Revise alignment and spacing of form fields and sections (Thibaud Colas) * Update Wagtail’s type scale so StreamField block labels and field labels are the same size (Thibaud Colas) * Style comments as per page editor design, in side panel (Karl Hobley, Thibaud Colas) * ReferenceIndex modified to only index Wagtail-related models, and allow other models to be explicitly registered (Daniel Kirkham) ### Bug fixes * Ensure `label_format` on StructBlock gracefully handles missing variables (Aadi jindal) * Adopt a no-JavaScript and more accessible solution for the ‘Reset to default’ switch to Gravatar when editing user profile (Loveth Omokaro) * Ensure `Site.get_site_root_paths` works on cache backends that do not preserve Python objects (Jaap Roes) * Ignore right clicks on side panel resizer (Sage Abdullah) * Resize in the correct direction for RTL languages with the side panel resizer (Sage Abdullah) * Fix image uploads on storage backends that require file pointer to be at the start of the file (Matt Westcott) * Fix “Edit this page” missing from userbar (Satvik Vashisht) * No longer allow invalid duplicate site hostname creation as hostnames and domain names are a case insensitive (Coen van der Kamp) * Image and Document multiple upload update forms now correctly use the progress button (longrunning) behavior when clicked (Loveth Omokaro) * Prevent audit log report from failing on missing models (Andy Chosak) * Ensure that the privacy collection privacy edit button is styled as a button (Jatin Kumar) * Fix page/snippet cannot proceed a `GroupApprovalTask` if it’s locked by someone outside of the group (Sage Abdullah) * Allow manual lock even if `WorkflowLock` is currently applied (Sage Abdullah) * Add missing log information for `wagtail.schedule.cancel` (Stefan Hammer) * Fix timezone activation leaking into subsequent requests in `require_admin_access()` (Stefan Hammer) * Fix dialog component’s message to have rounded corners at the top side (Sam) * When multiple documents are uploaded and then subsequently updated, ensure that existing success messages are cleared correctly (Aman Pandey) * Prevent matches from unrelated models from leaking into SQLite FTS searches (Matt Westcott) * Prevent duplicate addition of StreamField blocks with the new block picker (Deepam Priyadarshi) * Enable partial search on images and documents index view where available (Mng) * Adopt a no-JavaScript and more accessible solution for option selection in reporting, using HTML only `radio` input fields (Mehul Aggarwal) * Ensure that document search results count shows the correct all matches, not the paginate total (Andy Chosak) * Fix radio and checkbox elements shrinking when using a long label (Sage Abdullah) * Fix select elements expanding beyond their container when using a long option label (Sage Abdullah) * Fix timezone handling of `TemplateResponse`s for users with a custom timezone (Stefan Hammer, Sage Abdullah) * Ensure TableBlock initialization correctly runs after load and its width is aligned with the parent panel (Dan Braghis) * Ensure that the JavaScript media files are loaded by default in Snippet index listings for date fields (Sage Abdullah) * Fix server-side caching of the icons sprite (Thibaud Colas) * Avoid showing scrollbars in the block picker unless necessary (Babitha Kumari) * Always show Add buttons, guide lines, Move up/down, Duplicate, Delete; in StreamField and Inline Panel (Thibaud Colas) * Make admin JS i18n endpoint accessible to non-authenticated users (Matt Westcott) * Autosize text area field will now correctly resize when switching between comments toggle states (Suyash Srivastava) * Fix incorrect API serialization for document `download_url` when `WAGTAILDOCS_SERVE_METHOD` is `direct` (Swojak-A) * Fix template configuration of snippets index results view (fidoriel, Sage Abdullah) * Prevent long preview mode names from making the select element overflow the side panel (Sage Abdullah) * When i18n is not enabled, avoid making a Locale query on every page view (Dan Braghis) * Fix initialization of commenting widgets within StreamField (Thibaud Colas) * Fix various regressions in the commenting UI (Thibaud Colas) * Prevent TableBlock from becoming uneditable after save (Sage Abdullah) * Correctly show the “new item” badge within menu sections previously dismissed (Sage Abdullah) * Fix side panel stuck in resize state when pointer is released outside the grip (Sage Abdullah) ### Documentation * Add code block to make it easier to understand contribution docs (Suyash Singh) * Fix broken formatting for MultiFieldPanel / FieldRowPanel permission kwarg docs (Matt Westcott) * Add helpful troubleshooting links and refine wording for getting started with development (Loveth Omokaro) * Ensure search autocomplete overlay on mobile does not overflow the viewport (Ayman Makroo) * Improve documentation for InlinePanel (Vallabh Tiwari) * Remove confusing `SettingsPanel` reference in the page editing `TabbedInterface` example as `SettingsPanel` no longer shows anything as of 4.1 (Kenny Wolf, Julian Bigler) * Add contributor guidelines for building [Stimulus Controllers](../contributing/ui_guidelines.md#ui-guidelines-stimulus) (Thibaud Colas, Loveth Omokaro, LB (Ben) Johnston) * Fix typo in “Extending Draftail” documentation (Hans Kelson) * Clarify `ClusterableModel` requirements for using relations with `RevisionMixin`-enabled models (Sage Abdullah) * Add guide to making your first contribution (LB (Ben) Johnston) ### Maintenance * Removed features deprecated in Wagtail 3.0 and 4.0 (Matt Westcott) * Update djhtml (html formatting) library to v 1.5.2 (Loveth Omokaro) * Re-enable `strictPropertyInitialization` in tsconfig (Thibaud Colas) * Refactor accessibility checker userbar item (Albina Starykova) * Removed unused `Page.get_static_site_paths` method (Yosr Karoui) * Provisional Django 5.0 compatibility fixes (Sage Abdullah) * Add unit tests for `CollapseAll` and `MinimapItem` components (Albina Starykova) * Code quality fixes (GLEF1X) * Refactor image / document / snippet usage views into a shared generic view (Sage Abdullah) * Rename the Stimulus `AutoFieldController` to the less confusing `SubmitController` (Loveth Omokaro) * Replace `script` tags with `template` tag for image/document bulk uploads (Rishabh Kumar Bahukhandi) * Remove unneeded float styles on 404 page (Fabien Le Frapper) * Convert userbar implementation to TypeScript (Albina Starykova) * Migrate slug field behavior to a Stimulus controller and create new `SlugInput` widget (Loveth Omokaro) * Refactor `status` HTML usage to shared template tag (Aman Pandey, LB (Ben) Johnston, Himanshu Garg) * Add curlylint and update djhtml, semgrep versions in pre-commit config (Himanshu Garg) * Use shared header template for `ModelAdmin` and Snippets type index header (Aman Pandey) * Move models and forms for `wagtailsearch.Query` to `wagtail.contrib.search_promotions` (Karl Hobley) * Migrate `initErrorDetection` (tabs error counts) to a Stimulus Controller `w-count` (Aman Pandey) * Migrate `window.addMessage` behavior to a global event listener & Stimulus Controller approach with `w-messages` (Aman Pandey) * Update Algolia DocSearch to use new application and correct versioning setup (Thibaud Colas) * Move snippet choosers and model check registration to `SnippetViewSet.on_register()` (Sage Abdullah) * Remove unused snippets delete-multiple view (Sage Abdullah) * Improve performance of determining live page URLs across the admin interface using [`pageurl` template tag](../advanced_topics/performance.md#performance-page-urls) (Satvik Vashisht) * Migrate `window.initSlugAutoPopulate` behavior to a Stimulus Controller `w-sync` (Loveth Omokaro) * Rename `status` classes to `w-status` to align with preferred CSS class naming conventions (Mansi Gundre) * Include wagtail-factories in `wagtail.test.utils` to avoid cross-dependency issues (Matt Westcott) * Fix search tests to correctly reflect behavior of search backends other than the fallback backend (Matt Westcott) * Migrate select all checkbox in simple translation’s submit translation page to Stimulus controller `w-bulk`, remove inline script usage (Hanoon) * Refactor `SnippetViewSet` to extend `ModelViewSet` (Sage Abdullah) * Migrate initDismissibles behavior to a Stimulus controller `w-disimissible` (Loveth Omokaro) * Replace jQuery autosize v3 with Stimulus `w-autosize` controller using autosize npm package v6 (Suyash Srivastava) * Update `w-action` controller to support a click method (Suyash Srivastava) * Migrate the site settings switcher select from jQuery to a refined version of the `w-action` controller usage (Aadi jindal, LB (Ben) Johnston) * Always use expanded Sass output so CSS processing is identical in development and production builds (Thibaud Colas) * Refactor admin color palette to semantic, theme-agnostic design tokens (Thibaud Colas) ## Upgrade considerations ### Removal of deprecated features The following features deprecated in Wagtail 3.0 have been fully removed. See [Wagtail 3.0 release notes](3.0.md) for details on these changes, including how to remove usage of these features: * The modules `wagtail.core`, `wagtail.tests`, `wagtail.admin.edit_handlers` and `wagtail.contrib.forms.edit_handlers` are removed. * The field panel classes `StreamFieldPanel`, `RichTextFieldPanel`, `ImageChooserPanel`, `DocumentChooserPanel` and `SnippetChooserPanel` are removed. * StreamField definitions must include `use_json_field=True` (except migrations created before Wagtail 5.0). * The `BASE_URL` setting is no longer recognized. * The `ModelAdmin.get_form_fields_exclude` method is no longer passed a `request` argument. * The `ModelAdmin.get_edit_handler` method is no longer passed a `request` or `instance` argument. * The `widget_overrides`, `required_fields`, `required_formsets`, `bind_to`, `render_as_object` and `render_as_field` methods on `Panel` (previously `EditHandler`) are removed. The following features deprecated in Wagtail 4.0 have been fully removed. See [Wagtail 4.0 release notes](4.0.md) for details on these changes, including how to remove usage of these features: * The `wagtail.contrib.settings.models.BaseSetting` class is removed. * The `Page.get_latest_revision_as_page` method is removed. * The `page` and `page_id` properties and `as_page_object` method on `Revision` are removed. * The JavaScript functions `createPageChooser`, `createSnippetChooser`, `createDocumentChooser` and `createImageChooser` are removed. * The `wagtail.contrib.modeladmin.menus.SubMenu` class is removed. * Subclasses of `wagtail.contrib.modeladmin.helpers.AdminURLHelper` are now required to accept a `base_url_path` keyword argument on the constructor. * The `wagtail.admin.widgets.chooser.AdminChooser` class is removed. * The `wagtail.snippets.views.snippets.get_snippet_edit_handler` function is removed. ### Dropped support for Django 4.0 Django 4.0 reached end of life on 1st April 2023 and is no longer supported by Wagtail. Django 3.2 (LTS) is still supported until April 2024. ### Elasticsearch backend no longer performs partial matching on `search` The `search` method on pages, images and documents, and on the backend object returned by `wagtail.search.backends.get_search_backend()`, no longer performs partial word matching when the Elasticsearch backend is in use. Previously, a search query such as `Page.objects.search("cat")` would return results containing the word “caterpillar”, while `Page.objects.search("cat", partial_match=False)` would only return results for the exact word “cat”. The `search` method now always performs exact word matches, and the `partial_match` argument has no effect. This change makes the Elasticsearch backend consistent with the database-backed full-text search backends. To revert to the previous partial word matching behavior, use the `autocomplete` method instead - for example, `Page.objects.autocomplete("cat")`. It may also be necessary to add an [AutocompleteField](../topics/search/indexing.md#wagtailsearch-index-autocompletefield) entry for the relevant fields on the model’s `search_fields` definition, as the old `SearchField("some_field", partial_match=True)` format is no longer supported. The `partial_match` argument on `search` and `SearchField` is now deprecated, and should be removed from your code; it will be dropped entirely in Wagtail 6. ### ReferenceIndex no longer tracks models used outside of Wagtail When introduced in Wagtail 4.1, the `ReferenceIndex` model recorded references across all of a project’s models by default. The default set of models being indexed has now been changed to only those used within the Wagtail admin, specifically: * all Page types * Images * Documents * models registered as Snippets * models registered with ModelAdmin This change will remove the impact of the indexing on non-Wagtail apps and models. If you have models that still require reference indexing, and which are not registered as snippets or with ModelAdmin, you will need to explicitly register them within your app’s `AppConfig.ready()` method. See [Reference index](../advanced_topics/reference_index.md#registering-a-model-for-indexing) for further details. The use of `wagtail_reference_index_ignore` to prevent indexing of models is unchanged, but in many cases it may no longer be necessary. It is recommended that the `rebuild_references_index` management command is run after the upgrade to remove any unnecessary records. ### `Page.get_static_site_paths` method removed The undocumented `Page.get_static_site_paths` method (which returns a generator of URL paths for use by static site generator packages) has been removed. Packages relying on this functionality should provide their own fallback implementation. ### `wagtailsearch.Query` has moved to `wagtail.contrib.search_promotions` The `wagtailsearch.Query` model has been moved from the `search` application to the contrib application `wagtail.contrib.search_promotions`. All imports will need to be updated and migrations will need to be run via a management command, some imports will still work with a warning until a future version. To continue using the `Query` model, you must also add the `wagtail.contrib.search_promotions` application to your project’s `INSTALLED_APPS` setting. #### Migration command If you have daily hits records in the `wagtailsearch.Query` you can run the management command to move these records to the new location. ```sh ./manage.py copy_daily_hits_from_wagtailsearch ``` #### Managing stored search queries The `search_garbage_collect` command used to remove old stored search queries and daily hits has been moved to [`searchpromotions_garbage_collect`](../reference/contrib/searchpromotions.md#searchpromotions-garbage-collect). #### Import updates | **Import** | **Old import** | **New import** | |---------------|----------------------------------------------|-----------------------------------------------------------------| | `Query` Model | `from wagtail.search.models import Query` | `from wagtail.contrib.search_promotions.models import Query` | | `QueryForm` | `from wagtail.search.forms import QueryForm` | `from wagtail.contrib.search_promotions.forms import QueryForm` | ### Changes to header CSS classes in `ModelAdmin` templates If there are custom styles in place for the `ModelAdmin`’s header content or more complex template overrides in use, there are a few changes for the following classes to be aware of. | **Content** | **Old classes** | **New classes** | |----------------------------------|-----------------------|-------------------| | Heading & search (contains `h1`) | `.left.header-left` | `.left` | | Action buttons (`header_extra`) | `.right.header-right` | `.right` | ### Slug field auto-cleaning now relies on data attributes The slug field JavaScript behavior was previously attached to any field with an ID of `id_slug`, this has now changed to be any field with the appropriate Stimulus data attributes. If using a custom edit handler or set of panels for page models, the correct widget will now need to be used for these data attributes to be included. This widget will use the `WAGTAIL_ALLOW_UNICODE_SLUGS` Django setting. ```python from wagtail.admin.widgets.slug import SlugInput # ... other imports class MyPage(Page): promote_panels = [ FieldPanel("slug", widget=SlugInput), # ... other panels ] ``` Additionally, the slug behavior can be attached to any field easily by including the following attributes in HTML or via Django’s widget `attrs`. ```html ``` To allow unicode values, add the data attribute value; ```html ``` ### Changes to title / slug field synchronization The mechanism for synchronizing the slug field with the page title has changed, and is no longer hard-coded to activate on fields named ‘title’. Notably, this change affects page panel definitions that use `FieldPanel("title")` directly (rather than the convention of extending `Page.content_panels`), as well as non-page models such as snippets. To assist in upgrading these definitions, Wagtail 5.0.2 provides a new [TitleFieldPanel](../reference/panels.md#title-field-panel) class to be used in place of `FieldPanel("title")`. For example: ```python from wagtail.admin.panels import FieldPanel, MultiFieldPanel # ... content_panels = [ MultiFieldPanel([ FieldPanel("title"), FieldPanel("subtitle"), ]), ] ``` should become: ```python from wagtail.admin.panels import FieldPanel, MultiFieldPanel, TitleFieldPanel # ... content_panels = [ MultiFieldPanel([ TitleFieldPanel("title"), FieldPanel("subtitle"), ]), ] ``` If you have made deeper customizations to this behavior, or are unable to upgrade to Wagtail 5.0.2 or above, please read on as you may need to make some changes to adopt the new approach. The title field will sync its value with the slug field on Pages if the Page is not published and the slug has not been manually changed. This JavaScript behavior previously attached to any field with an ID of `id_title`; this has now changed to be any field with the appropriate Stimulus data attributes. There is a new Stimulus controller `w-sync` which allows any field to change one or more other fields when its value changes, the other field in this case will be the slug field (`w-slug`) with the id `id_slug`. If you need to hook into this behavior, the new approach will now correctly dispatch `change` events on the slug field. Alternatively, you can modify the data attributes on the fields to adjust this behavior. To adjust the target field (the one to be updated), you cam modify `"data-w-sync-target-value"`, the default being `"body:not(.page-is-live) [data-edit-form] #id_slug"` (find the field with id `id_slug` when the page is not live). To adjust what triggers the initial check (to see if the fields should be in sync), or the trigger the sync, you can use the Stimulus `data-action` attributes. ```html ``` Above we have adjusted these attributes to add a ‘change’ event listener to trigger the sync and also adjusted to look for a field with `some_other_slug` instead. ### Auto height/size text area widget now relies on data attributes If you are using the `wagtail.admin.widgets.AdminAutoHeightTextInput` only, this change will have no impact when upgrading. However, if you are relying on the global `autosize` function at `window.autosize` on the client, this will no longer work. It is recommended that the `AdminAutoHeightTextInput` widget be used instead. You can also adopt the `data-controller` attribute and this will now function as before. Alternatively, you can simply add the required Stimulus data controller attribute as shown below. **Old syntax** ```html ``` **New syntax** ```html ``` There are no additional data attributes supported at this time. ### Progress button (`button-longrunning`) now relies on data attributes The `button-longrunning` class usage has been updated to use the newly adopted Stimulus approach, the previous data attributes will be deprecated in a future release. If using the old approach, ensure any HTML templates are updated to the new approach before the next major release. **Old syntax** ```html+django ``` **New syntax** Minimum required attributes are `data-controller` and a `data-action`. ```html+django ``` #### Examples of additional capabilities Stimulus [targets](https://stimulus.hotwired.dev/reference/targets) and [actions](https://stimulus.hotwired.dev/reference/actions) can be leveraged to revise the behavior via data attributes. * `` - any element can be the button label (not just `em`) * `