2.0.rst 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. ==========================================
  2. Wagtail 2.0 release notes - IN DEVELOPMENT
  3. ==========================================
  4. .. contents::
  5. :local:
  6. :depth: 1
  7. What's new
  8. ==========
  9. Reorganised modules
  10. ~~~~~~~~~~~~~~~~~~~
  11. The modules that make up Wagtail have been renamed and reorganised, to avoid the repetition in names like ``wagtail.wagtailcore.models`` (originally an artefact 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.
  12. Other features
  13. ~~~~~~~~~~~~~~
  14. * Moved Wagtail API v1 implementation (``wagtail.contrib.api``) to an `external app <https://github.com/wagtail/wagtailapi_legacy>`_ (Karl Hobley)
  15. * The page chooser now searches all fields of a page, instead of just the title (Bertrand Bordage)
  16. * Implement ordering by date in form submission view (LB (Ben Johnston))
  17. * Elasticsearch scroll API is now used when fetching more than 100 search results (Karl Hobley)
  18. * Added hidden field to the form builder (Ross Crawford-d'Heureuse)
  19. * Usage count now shows on delete confirmation page when WAGTAIL_USAGE_COUNT_ENABLED is active (Kees Hink)
  20. * Added usage count to snippets (Kees Hink)
  21. * Moved usage count to the sidebar on the edit page (Kees Hink)
  22. * Explorer menu now reflects customisations to the page listing made via the `construct_explorer_page_queryset` hook and `ModelAdmin.exclude_from_explorer` property (Tim Heap)
  23. * "Choose another image" button changed to "Change image" to avoid ambiguity (Edd Baldry)
  24. * Added hooks ``before_create_user``, ``after_create_user``, ``before_delete_user``, ``after_delete_user``, ``before_edit_user``, ``after_edit_user`` (Jon Carmack)
  25. * Added ``exclude_fields_in_copy`` property to Page to define fields that should not be included on page copy (LB (Ben Johnston))
  26. * Improved error message on incorrect ``{% image %}`` tag syntax (LB (Ben Johnston))
  27. * Optimized preview data storage (Bertrand Bordage)
  28. * Added ``render_landing_page`` method to ``AbstractForm`` to be easily overridden and pass ``form_submission`` to landing page context (Stein Strindhaug)
  29. * Added ``heading`` kwarg to ``InlinePanel`` to allow heading to be set independently of button label (Adrian Turjak)
  30. * The value type returned from a ``StructBlock`` can now be customised. See :ref:`custom_value_class_for_structblock` (LB (Ben Johnston))
  31. * Added `bgcolor` image operation (Karl Hobley)
  32. Bug fixes
  33. ~~~~~~~~~
  34. * Do not remove stopwords when generating slugs from non-ASCII titles, to avoid issues with incorrect word boundaries (Sævar Öfjörð Magnússon)
  35. * The PostgreSQL search backend now preserves ordering of the ``QuerySet`` when searching with ``order_by_relevance=False`` (Bertrand Bordage)
  36. * Using ``modeladmin_register`` as a decorator no longer replaces the decorated class with ``None`` (Tim Heap)
  37. * Fixed crash in XML sitemap generator when all pages on the site are private (Stein Strindhaug)
  38. * The ``{% routablepageurl %}`` template tag no longer generates invalid URLs when the ``WAGTAIL_APPEND_SLASH`` setting was set to ``False`` (Venelin Stoykov)
  39. * The "View live" button is no longer shown if the page doesn't have a routable URL (Tim Heap)
  40. * API listing views no longer fail when no site records are defined (Karl Hobley)
  41. * Fixed rendering of border on dropdown arrow buttons on Chrome (Bertrand Bordage)
  42. * Fixed incorrect z-index on userbar causing it to appear behind page content (Stein Strindhaug)
  43. * Form submissions pagination no longer looses date filter when changing page (Bertrand Bordage)
  44. * PostgreSQL search backend now removes duplicate page instances from the database (Bertrand Bordage)
  45. * ``FormSubmissionsPanel`` now recognises custom form submission classes (LB (Ben Johnston))
  46. * Prevent the footer and revisions link from unnecessarily collapsing on mobile (Jack Paine)
  47. * Empty searches were activated when paginating through images and documents (LB (Ben Johnston))
  48. * Summary numbers of pages, images and documents were not responsive when greater than 4 digits (Michael Palmer)
  49. * Project template now has password validators enabled by default (Matt Westcott)
  50. * Alignment options correctly removed from ``TableBlock`` context menu (LB (Ben Johnston))
  51. * Fix support of ``ATOMIC_REBUILD`` for projects with Elasticsearch client ``>=1.7.0`` (Mikalai Radchuk)
  52. * Fixed error on Elasticsearch backend when passing a queryset as an ``__in`` filter (Karl Hobley, Matt Westcott)
  53. * ``__isnull`` filters no longer fail on Elasticsearch 5 (Karl Hobley)
  54. * Prevented intermittent failures on Postgres search backend when a field is defined as both a ``SearchField`` and a ``FilterField`` (Matt Westcott)
  55. * Alt text of images in rich text is no longer truncated on double-quote characters (Matt Westcott)
  56. * Ampersands in embed URLs within rich text are no longer double-escaped (Matt Westcott)
  57. * Using RGBA images no longer crashes with Pillow >= 4.2.0 (Karl Hobley)
  58. Upgrade considerations
  59. ======================
  60. Removed support for Python 2.7, Django 1.8 and Django 1.10
  61. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  62. 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.
  63. Added support for Django 2.0
  64. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  65. Before upgrading to Django 2.0, you are advised to review the `release notes <https://docs.djangoproject.com/en/2.0/releases/2.0/>`_, especially the `backwards incompatible changes <https://docs.djangoproject.com/en/2.0/releases/2.0/#backwards-incompatible-changes-in-2-0>`_ and `removed features <https://docs.djangoproject.com/en/2.0/releases/2.0/#features-removed-in-2-0>`_.
  66. Wagtail module path updates
  67. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  68. Many of the module paths within Wagtail have been reorganised:
  69. +-----------------------------------------+-----------------------------------+-----------------------------------+
  70. | Old name | New name | Notes |
  71. +=========================================+===================================+===================================+
  72. | wagtail.wagtailcore | wagtail.core | |
  73. +-----------------------------------------+-----------------------------------+-----------------------------------+
  74. | wagtail.wagtailadmin | wagtail.admin | |
  75. +-----------------------------------------+-----------------------------------+-----------------------------------+
  76. | wagtail.wagtaildocs | wagtail.documents | 'documents' no longer abbreviated |
  77. +-----------------------------------------+-----------------------------------+-----------------------------------+
  78. | wagtail.wagtailembeds | wagtail.embeds | |
  79. +-----------------------------------------+-----------------------------------+-----------------------------------+
  80. | wagtail.wagtailimages | wagtail.images | |
  81. +-----------------------------------------+-----------------------------------+-----------------------------------+
  82. | wagtail.wagtailsearch | wagtail.search | |
  83. +-----------------------------------------+-----------------------------------+-----------------------------------+
  84. | wagtail.wagtailsites | wagtail.sites | |
  85. +-----------------------------------------+-----------------------------------+-----------------------------------+
  86. | wagtail.wagtailsnippets | wagtail.snippets | |
  87. +-----------------------------------------+-----------------------------------+-----------------------------------+
  88. | wagtail.wagtailusers | wagtail.users | |
  89. +-----------------------------------------+-----------------------------------+-----------------------------------+
  90. | wagtail.wagtailforms | wagtail.contrib.forms | Moved into 'contrib' |
  91. +-----------------------------------------+-----------------------------------+-----------------------------------+
  92. | wagtail.wagtailredirects | wagtail.contrib.redirects | Moved into 'contrib' |
  93. +-----------------------------------------+-----------------------------------+-----------------------------------+
  94. | wagtail.contrib.wagtailapi | *removed* | API v1, removed in this release |
  95. +-----------------------------------------+-----------------------------------+-----------------------------------+
  96. | wagtail.contrib.wagtailfrontendcache | wagtail.contrib.frontend_cache | Underscore added |
  97. +-----------------------------------------+-----------------------------------+-----------------------------------+
  98. | wagtail.contrib.wagtailroutablepage | wagtail.contrib.routable_page | Underscore added |
  99. +-----------------------------------------+-----------------------------------+-----------------------------------+
  100. | wagtail.contrib.wagtailsearchpromotions | wagtail.contrib.search_promotions | Underscore added |
  101. +-----------------------------------------+-----------------------------------+-----------------------------------+
  102. | wagtail.contrib.wagtailsitemaps | wagtail.contrib.sitemaps | |
  103. +-----------------------------------------+-----------------------------------+-----------------------------------+
  104. | wagtail.contrib.wagtailstyleguide | wagtail.contrib.styleguide | |
  105. +-----------------------------------------+-----------------------------------+-----------------------------------+
  106. References to these module paths within your Wagtail project need to be updated when you upgrade to Wagtail 2.0. This includes:
  107. * ``import`` lines
  108. * Paths specified in settings, such as ``INSTALLED_APPS``, ``MIDDLEWARE`` and ``WAGTAILSEARCH_BACKENDS``
  109. * Fields and blocks referenced within migrations, such as ``wagtail.wagtailcore.fields.StreamField`` and ``wagtail.wagtailcore.blocks.RichTextBlock``
  110. 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:
  111. * Foreign keys specifying a model as ``'app_name.ModelName'``, e.g. ``models.ForeignKey('wagtailimages.Image',...)``
  112. * App labels used in database table names, content types or permissions
  113. * Paths to templates and static files, e.g. when :ref:`overriding admin templates with custom branding <custom_branding>`
  114. * Template tag library names, e.g. ``{% load wagtailcore_tags %}``
  115. Removed support for Elasticsearch 1.x
  116. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  117. 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.
  118. Removed version 1 of the Wagtail API
  119. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  120. Version 1 of the Wagtail API (``wagtail.contrib.wagtailapi``) has been removed from Wagtail.
  121. If you're using version 1, you will need to migrate to version 2. Please see
  122. :doc:`/advanced_topics/api/v2/configuration` and :doc:`/advanced_topics/api/v2/usage`.
  123. If migrating to version 2 is not an option right now (if you have API clients that you don't
  124. have direct control over, such as a mobile app), you can find the implementation of the
  125. version 1 API in the new `wagtailapi_legacy <https://github.com/wagtail/wagtailapi_legacy>`_ repository.
  126. This repository has been created to provide a place for the community to collaborate on supporting
  127. legacy versions of the API until everyone has migrated to an officially supported version.
  128. ``wagtail.images.views.serve.generate_signature`` now returns a string
  129. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  130. The ``generate_signature`` function in ``wagtail.images.views.serve``, used to build URLs for the :ref:`dynamic image serve view <using_images_outside_wagtail>`, now returns a string rather than a binary 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 binary strings to be passed to ``reverse``). Any code that expects a binary 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``.)