2.9.rst 7.2 KB

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