wagtail/docs/releases/2.11.rst

110 wiersze
6.8 KiB
ReStructuredText
Czysty Zwykły widok Historia

2020-07-28 10:26:51 +00:00
===========================================
Wagtail 2.11 release notes - IN DEVELOPMENT
===========================================
.. contents::
:local:
:depth: 1
What's new
==========
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.
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.
2020-07-28 10:26:51 +00:00
Other features
~~~~~~~~~~~~~~
* Add ``before_edit_snippet``, ``before_create_snippet`` and ``before_delete_snippet`` hooks and documentation (Karl Hobley. Sponsored by the Mozilla Foundation)
2020-08-07 14:51:09 +00:00
* Add ``register_snippet_listing_buttons`` and ``construct_snippet_listing_buttons`` hooks and documentation (Karl Hobley. Sponsored by the Mozilla Foundation)
2020-08-03 13:21:48 +00:00
* Add ``wagtail --version`` to available Wagtail CLI commands (Kalob Taulien)
2020-08-07 14:51:09 +00:00
* 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)
2020-09-02 09:36:27 +00:00
* 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)
2020-09-03 19:11:22 +00:00
* 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)
2020-09-02 21:23:28 +00:00
* 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)
* 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)
2020-09-28 12:53:49 +00:00
* 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)
2020-09-15 10:26:02 +00:00
* 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)
2020-10-18 14:31:56 +00:00
* Implement ``bulk_to_python`` on all structural StreamField block types (Matt Westcott)
* Add natural key support to ``GroupCollectionPermission`` (Jim Jazwiecki)
2020-07-28 10:26:51 +00:00
Bug fixes
~~~~~~~~~
2020-08-04 15:03:15 +00:00
* 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)
2020-09-02 19:42:56 +00:00
* 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)
2020-09-28 12:53:49 +00:00
* 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)
2020-07-28 10:26:51 +00:00
Upgrade considerations
======================
SiteMiddleware moved to ``wagtail.contrib.legacy``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2020-08-27 15:07:22 +00:00
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'``.
2020-09-02 21:23:28 +00:00
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:
2020-09-02 21:23:28 +00:00
.. code-block:: python
2020-09-02 21:23:28 +00:00
from wagtail.core.models import Collection
Collection.fix_tree(fix_paths=True)
2020-09-02 21:23:28 +00:00
or the management command:
2020-09-02 21:23:28 +00:00
.. code-block:: console
2020-09-02 21:23:28 +00:00
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.