2.8.rst 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. =========================
  2. Wagtail 2.8 release notes
  3. =========================
  4. *February 3, 2020*
  5. .. contents::
  6. :local:
  7. :depth: 1
  8. What's new
  9. ==========
  10. Django 3.0 support
  11. ~~~~~~~~~~~~~~~~~~
  12. This release is compatible with Django 3.0. Compatibility fixes were contributed by Matt Westcott and Mads Jensen.
  13. Improved page locking
  14. ~~~~~~~~~~~~~~~~~~~~~
  15. 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.
  16. This feature was developed by Karl Hobley and Jacob Topp-Mugglestone. Thanks to `The Motley Fool <https://www.fool.com/>`_ for sponsoring this feature.
  17. Other features
  18. ~~~~~~~~~~~~~~
  19. * Removed leftover Python 2.x compatibility code (Sergey Fedoseev)
  20. * Combine flake8 configurations (Sergey Fedoseev)
  21. * Improve diffing behaviour for text fields (Aliosha Padovani)
  22. * Improve contrast of disabled inputs (Nick Smith)
  23. * Added ``get_document_model_string`` function (Andrey Smirnov)
  24. * Added support for Cloudflare API tokens for frontend cache invalidation (Tom Usher)
  25. * Cloudflare frontend cache invalidation requests are now sent in chunks of 30 to fit within API limits (Tom Usher)
  26. * Added ``ancestors`` field to the pages endpoint in admin API (Karl Hobley)
  27. * Removed Django admin management of ``Page`` & ``Site`` models (Andreas Bernacca)
  28. * Cleaned up Django docs URLs in documentation (Pete Andrew)
  29. * Add StreamFieldPanel to available panel types in documentation (Dan Swain)
  30. * Add ``{{ block.super }}`` example to ModelAdmin customisation in documentation (Dan Swain)
  31. * Add ability to filter image index by a tag (Benedikt Willi)
  32. * Add partial experimental support for nested InlinePanels (Matt Westcott, Sam Costigan, Andy Chosak, Scott Cranfill)
  33. * Added cache control headers when serving documents (Johannes Vogel)
  34. * Use ``sensitive_post_parameters`` on password reset form (Dan Braghis)
  35. * Add ``WAGTAILEMBEDS_RESPONSIVE_HTML`` setting to remove automatic addition of ``responsive-object`` around embeds (Kalob Taulien)
  36. Bug fixes
  37. ~~~~~~~~~
  38. * Rename documents listing column 'uploaded' to 'created' (LB (Ben Johnston))
  39. * Unbundle the l18n library as it was bundled to avoid installation errors which have been resolved (Matt Westcott)
  40. * Prevent error when comparing pages that reference a model with a custom primary key (Fidel Ramos)
  41. * Moved ``get_document_model`` location so it can be imported when Models are not yet loaded (Andrey Smirnov)
  42. * Use correct HTML escaping of Jinja2 form templates for StructBlocks (Brady Moe)
  43. * All templates with wagtailsettings and modeladmin now use ``block.super`` for ``extra_js`` & ``extra_css`` (Timothy Bautista)
  44. * Layout issue when using ``FieldRowPanel`` with a heading (Andreas Bernacca)
  45. * ``file_size`` and ``file_hash`` now updated when Document file changed (Andreas Bernacca)
  46. * Fixed order of URLs in project template so that static / media URLs are not blocked (Nick Smith)
  47. * Added ``verbose_name_plural`` to form submission model (Janneke Janssen)
  48. * Prevent ``update_index`` failures and incorrect front-end rendering on blank ``TableBlock`` (Carlo Ascani)
  49. * Dropdown initialisation on the search page after AJAX call (Eric Sherman)
  50. * Make sure all modal chooser search results correspond to the latest search by cancelling previous requests (Esper Kuijs)
  51. Upgrade considerations
  52. ======================
  53. Removed support for Django 2.0
  54. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  55. Django 2.0 is no longer supported as of this release; please upgrade to Django 2.1 or above before upgrading Wagtail.
  56. Edit locking behaviour changed
  57. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  58. The behaviour of the page locking feature in the admin interface has been changed.
  59. In past versions, the page lock would apply to all users including the user who
  60. locked the page. Now, the user who locked the page can still edit it but all other
  61. users cannot.
  62. Pages that were locked before this release will continue to be locked in the same
  63. way as before, so this only applies to newly locked pages. If you would like to
  64. restore the previous behaviour, you can set the
  65. ``WAGTAILADMIN_GLOBAL_PAGE_EDIT_LOCK`` setting to ``True``.
  66. Responsive HTML for embeds no longer added by default
  67. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  68. In previous versions of Wagtail, embedded media elements were given
  69. a class name of ``responsive-object`` and an inline ``padding-bottom`` style to assist
  70. in styling them responsively. These are no longer added by default. To restore the previous
  71. behaviour, add ``WAGTAILEMBEDS_RESPONSIVE_HTML = True`` to your project settings.
  72. API endpoint classes have moved
  73. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  74. 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.
  75. Old code:
  76. .. code-block:: python
  77. from wagtail.api.v2.endpoints import PagesAPIEndpoint
  78. from wagtail.api.v2.router import WagtailAPIRouter
  79. from wagtail.images.api.v2.endpoints import ImagesAPIEndpoint
  80. from wagtail.documents.api.v2.endpoints import DocumentsAPIEndpoint
  81. api_router = WagtailAPIRouter('wagtailapi')
  82. api_router.register_endpoint('pages', PagesAPIEndpoint)
  83. api_router.register_endpoint('images', ImagesAPIEndpoint)
  84. api_router.register_endpoint('documents', DocumentsAPIEndpoint)
  85. New code:
  86. .. code-block:: python
  87. from wagtail.api.v2.views import PagesAPIViewSet
  88. from wagtail.api.v2.router import WagtailAPIRouter
  89. from wagtail.images.api.v2.views import ImagesAPIViewSet
  90. from wagtail.documents.api.v2.views import DocumentsAPIViewSet
  91. api_router = WagtailAPIRouter('wagtailapi')
  92. api_router.register_endpoint('pages', PagesAPIViewSet)
  93. api_router.register_endpoint('images', ImagesAPIViewSet)
  94. api_router.register_endpoint('documents', DocumentsAPIViewSet)
  95. ``wagtail.documents.models.get_document_model`` has moved
  96. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  97. The ``get_document_model`` function should now be imported from ``wagtail.documents`` rather than ``wagtail.documents.models``. See :ref:`custom_document_model`.
  98. Removed ``Page`` and ``Site`` models from Django admin
  99. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  100. 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/2.2/ref/contrib/admin/#modeladmin-objects>`_:
  101. .. code-block:: python
  102. # my_app/admin.py
  103. from django.contrib import admin
  104. from wagtail.core.models import Page, Site
  105. admin.site.register(Site)
  106. admin.site.register(Page)