2.9.rst 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. =========================
  2. Wagtail 2.9 release notes
  3. =========================
  4. .. contents::
  5. :local:
  6. :depth: 1
  7. What's new
  8. ==========
  9. Report data exports
  10. ~~~~~~~~~~~~~~~~~~~
  11. 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/>`_.
  12. CVE-2020-11037: Potential timing attack on password-protected private pages
  13. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  14. 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>`_.)
  15. Many thanks to Thibaud Colas for reporting this issue.
  16. Other features
  17. ~~~~~~~~~~~~~~
  18. * Added support for creating custom reports (Jacob Topp-Mugglestone)
  19. * Skip page validation when unpublishing a page (Samir Shah)
  20. * Added :ref:`streamfield_multiplechoiceblock` block type for StreamField (James O'Toole)
  21. * ChoiceBlock now accepts a ``widget`` keyword argument (James O'Toole)
  22. * Reduced contrast of rich text toolbar (Jack Paine)
  23. * Support the rel attribute on custom ModelAdmin buttons (Andy Chosak)
  24. * Server-side page slug generation now respects ``WAGTAIL_ALLOW_UNICODE_SLUGS`` (Arkadiusz Michał Ryś)
  25. * Wagtail admin no longer depends on SiteMiddleware, avoiding incompatibility with Django sites framework and redundant database queries (aritas1, timmysmalls, Matt Westcott)
  26. * Tag field autocompletion now handles custom tag models (Matt Westcott)
  27. * ``wagtail_serve`` URL route can now be omitted for headless sites (Storm Heg)
  28. * Allow free tagging to be disabled on custom tag models (Matt Westcott)
  29. * Allow disabling page preview by setting ``preview_modes`` to an empty list (Casper Timmers)
  30. * Add Vidyard to oEmbed provider list (Steve Lyall)
  31. * Optimise compiling media definitions for complex StreamBlocks (pimarc)
  32. * FieldPanel now accepts a 'heading' argument (Jacob Topp-Mugglestone)
  33. * Replaced deprecated ``ugettext`` / ``ungettext`` calls with ``gettext`` / ``ngettext`` (Mohamed Feddad)
  34. * ListBlocks now call child block ``bulk_to_python`` if defined (Andy Chosak)
  35. * Site settings are now identifiable/cachable by request as well as site (Andy Babic)
  36. * Added ``select_related`` attribute to site settings to enable more efficient fetching of foreign key values (Andy Babic)
  37. * Add caching of image renditions (Tom Dyson, Tim Kamanin)
  38. * Add documentation for reporting security issues and internationalisation (Matt Westcott)
  39. * Fields on a custom image model can now be defined as required ``blank=False`` (Matt Westcott)
  40. Bug fixes
  41. ~~~~~~~~~
  42. * Added ARIA alert role to live search forms in the admin (Casper Timmers)
  43. * Reordered login form elements to match expected tab order (Kjartan Sverrisson)
  44. * Re-added 'Close Explorer' button on mobile viewports (Sævar Öfjörð Magnússon)
  45. * Added a more descriptive label to Password reset link for screen reader users (Casper Timmers, Martin Coote)
  46. * Improved Wagtail logo contrast by adding a background (Brian Edelman, Simon Evans, Ben Enright)
  47. * Prevent duplicate notification messages on page locking (Jacob Topp-Mugglestone)
  48. * Rendering of non field errors for InlinePanel items (Storm Heg)
  49. * ``{% image ... as var %}`` now clears the context variable when passed None as an image (Maylon Pedroso)
  50. * ``refresh_index`` method on Elasticsearch no longer fails (Lars van de Kerkhof)
  51. * Document tags no longer fail to update when replacing the document file at the same time (Matt Westcott)
  52. * Prevent error from very tall / wide images being resized to 0 pixels (Fidel Ramos)
  53. * Remove excess margin when editing snippets (Quadric)
  54. * Added ``scope`` attribute to table headers in TableBlock output (Quadric)
  55. * Prevent KeyError when accessing a StreamField on a deferred queryset (Paulo Alvarado)
  56. * Hide empty 'view live' links (Karran Besen)
  57. * Mark up a few strings for translation (Luiz Boaretto)
  58. * Invalid focal_point attribute on image edit view (Michał (Quadric) Sieradzki)
  59. * No longer expose the ``.delete()`` method on the default Page.objects manager (Nick Smith)
  60. * ``exclude_fields_in_copy`` on Page models will now work for for modelcluster parental / many to many relations (LB (Ben Johnston))
  61. * Response header (content disposition) now correctly handles filenames with non-ascii characters when using a storage backend (Rich Brennan)
  62. * Improved accessibility fixes for ``main``, ``header`` and ``footer`` elements in the admin page layout (Mitchel Cabuloy)
  63. * Prevent version number from obscuring long settings menus (Naomi Morduch Toubman)
  64. * Admin views using TemplateResponse now respect the user's language setting (Jacob Topp-Mugglestone)
  65. * Fixed incorrect language code for Japanese in language setting dropdown (Tomonori Tanabe)
  66. Upgrade considerations
  67. ======================
  68. Removed support for Django 2.1
  69. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  70. Django 2.1 is no longer supported as of this release; please upgrade to Django 2.2 or above before upgrading Wagtail.
  71. ``SiteMiddleware`` and ``request.site`` deprecated
  72. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  73. Wagtail's :class:`~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.
  74. For example:
  75. .. code-block:: python
  76. # old version
  77. def get_menu_items(request):
  78. return request.site.root_page.get_children().live()
  79. # new version
  80. from wagtail.core.models import Site
  81. def get_menu_items(request):
  82. return Site.find_for_request(request).root_page.get_children().live()
  83. .. code-block:: html+django
  84. {# old version #}
  85. <h1>Welcome to the {{ request.site.site_name }} website!</h1>
  86. {# new version #}
  87. {% load wagtailcore_tags %}
  88. {% wagtail_site as current_site %}
  89. <h1>Welcome to the {{ current_site.site_name }} website!</h1>
  90. Once these are removed, ``'wagtail.core.middleware.SiteMiddleware'`` can be removed from your project's ``MIDDLEWARE`` setting.
  91. Page / Collection managers no longer expose a ``delete`` method
  92. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  93. For `consistency with standard Django models <https://docs.djangoproject.com/en/stable/topics/db/queries/#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()``.