0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-29 17:36:49 +01:00
wagtail/docs/releases/2.5.rst
2019-03-14 14:43:28 +01:00

97 lines
5.5 KiB
ReStructuredText

==========================================
Wagtail 2.5 release notes - IN DEVELOPMENT
==========================================
.. contents::
:local:
:depth: 1
What's new
==========
Other features
~~~~~~~~~~~~~~
* Added support for customising EditHandler-based forms on a per-request basis (Bertrand Bordage)
* Added more informative error message when ``|richtext`` filter is applied to a non-string value (mukesh5)
* Automatic search indexing can now be disabled on a per-model basis via the ``search_auto_update`` attribute (Karl Hobley)
* Improved diffing of StreamFields when comparing page revisions (Karl Hobley)
* Highlight broken links to pages and missing documents in rich text (Brady Moe)
* Preserve links when copy-pasting rich text content from Wagtail to other tools (Thibaud Colas)
* Rich text to contentstate conversion now prioritises more specific rules, to accommodate ``<p>`` and ``<br>`` elements with attributes (Matt Westcott)
* Added limit image upload size by number of pixels (Thomas Elliott)
* Added ``manage.py wagtail_update_index`` alias to avoid clashes with ``update_index`` commands from other packages (Matt Westcott)
* Renamed ``target_model`` argument on ``PageChooserBlock`` to ``page_type`` (Loic Teixeira)
* ``edit_handler`` and ``panels`` can now be defined on a ``ModelAdmin`` definition (Thomas Kremmel)
* Add Learn Wagtail to third-party tutorials in documentation (Matt Westcott)
* Add a Django setting ``TAG_LIMIT`` to limit number of tags that can be added to any taggit model (Mani)
* Added instructions on how to generate urls for ``ModelAdmin`` to documentation (LB (Ben Johnston), Andy Babic)
* Added option to specify a fallback URL on ``{% pageurl %}`` (Arthur Holzner)
Bug fixes
~~~~~~~~~
* Set ``SERVER_PORT`` to 443 in ``Page.dummy_request()`` for HTTPS sites (Sergey Fedoseev)
* Include port number in ``Host`` header of ``Page.dummy_request()`` (Sergey Fedoseev)
* Validation error messages in ``InlinePanel`` no longer count towards ``max_num`` when disabling the 'add' button (Todd Dembrey, Thibaud Colas)
* Rich text to contentstate conversion now ignores stray closing tags (frmdstryr)
* Escape backslashes in ``postgres_search`` queries (Hammy Goonan)
* Parent page link in page chooser search results no longer navigates away (Asanka Lihiniyagoda, Sævar Öfjörð Magnússon)
* ``routablepageurl`` tag now correctly omits domain part when multiple sites exist at the same root (Gassan Gousseinov)
* Added missing collection column specifier on document listing template (Sergey Fedoseev)
* Page Copy will now also copy ParentalManyToMany field relations (LB (Ben Johnston))
* Admin HTML header now includes correct language code (Matt Westcott)
* Unclear error message when saving image after focal point edit (Hugo van den Berg)
* Increase max length on ``Embed.thumbnail_url`` to 255 characters (Kevin Howbrook)
* ``send_mail`` now correctly uses the ``html_message`` kwarg for HTML messages (Tiago Requeijo)
* Page copying no longer allowed if page model has reached its ``max_count`` (Andy Babic)
* Don't show page type on page chooser button when multiple types are allowed (Thijs Kramer)
* Make sure page chooser search results correspond to the latest search by canceling previous requests (Esper Kuijs)
* Inform user when moving a page from one parent to another where there is an already existing page with the same slug (Casper Timmers)
* User add/edit forms now support form widgets with JS/CSS media (Damian Grinwis)
Upgrade considerations
======================
``EditHandler.bind_to_model`` and ``EditHandler.bind_to_instance`` deprecated
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The internal ``EditHandler`` methods ``bind_to_model`` and ``bind_to_instance`` have been deprecated, in favour of a new combined ``bind_to`` method which accepts ``model``, ``instance``, ``request`` and ``form`` as optional keyword arguments. Any user code which calls ``EditHandler.bind_to_model(model)`` should be updated to use ``EditHandler.bind_to(model=model)`` instead; any user code which calls ``EditHandler.bind_to_instance(instance, request, form)`` should be updated to use ``EditHandler.bind_to(instance=instance, request=request, form=form)``.
Changes to admin pagination helpers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A number of changes have been made to pagination handling within the Wagtail admin; these are internal API changes, but may affect applications and third-party packages that add new paginated object listings, including chooser modals, to the admin. The ``paginate`` function in ``wagtail.utils.pagination`` has been deprecated in favour of the ``django.core.paginator.Paginator.get_page`` method introduced in Django 2.0 - a call such as:
.. code-block:: python
from wagtail.utils.pagination import paginate
paginator, page = paginate(request, object_list, per_page=25)
should be replaced with:
.. code-block:: python
from django.core.paginator import Paginator
paginator = Paginator(object_list, per_page=25)
page = paginator.get_page(request.GET.get('p'))
Additionally, the ``is_ajax`` flag on the template ``wagtailadmin/shared/pagination_nav.html`` has been deprecated in favour of a new template ``wagtailadmin/shared/ajax_pagination_nav.html``:
.. code-block:: html+django
{% include "wagtailadmin/shared/pagination_nav.html" with items=page_obj is_ajax=1 %}
should become:
.. code-block:: html+django
{% include "wagtailadmin/shared/ajax_pagination_nav.html" with items=page_obj %}