0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-30 01:46:24 +01:00
wagtail/docs/releases/1.9.rst

81 lines
3.9 KiB
ReStructuredText
Raw Normal View History

2016-12-09 16:43:53 +01:00
==========================================
Wagtail 1.9 release notes - IN DEVELOPMENT
==========================================
.. contents::
:local:
:depth: 1
What's new
==========
Bulk-deletion of form submissions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Form builder form submissions can now be deleted in bulk from the form submissions index page. This feature was sponsored by St John's College, Oxford and developed by Karl Hobley.
Accessing parent context from StreamField block ``get_context`` methods
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2016-12-09 16:43:53 +01:00
The ``get_context`` method on StreamField blocks now receives a ``parent_context`` keyword argument, consisting of the dict of variables passed in from the calling template. For example, this makes it possible to perform pagination logic within ``get_context``, retrieving the current page number from ``parent_context['request'].GET``. See :ref:`get_context on StreamField blocks <streamfield_get_context>`. This feature was developed by Mikael Svensson and Peter Baumgartner.
2016-12-09 16:43:53 +01:00
Welcome message customisation for multi-tenanted installations
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The welcome message on the admin dashboard has been updated to be more suitable for multi-tenanted installations. Users whose page permissions lie within a single site will now see that site name in the welcome message, rather than the installation-wide ``WAGTAIL_SITE_NAME``. As before, this message can be customised, and additional template variables have been provided for this purpose - see :ref:`custom_branding`. This feature was developed by Jeffrey Chau.
Other features
2016-12-09 16:43:53 +01:00
~~~~~~~~~~~~~~
* Added :ref:`before_copy_page` and :ref:`after_copy_page` hooks (Matheus Bratfisch)
* View live / draft links in the admin now consistently open in a new window (Marco Fucci)
* ``ChoiceBlock`` now omits the blank option if the block is required and has a default value (Andreas Nüßlein)
* The ``add_subpage`` view now maintains a ``next`` URL parameter to specify where to redirect to after completing page creation (Robert Rollins)
2017-01-25 19:58:58 +01:00
* The ``wagtailforms`` module now allows to define custom form submission model, add custom data to CSV export and some other customisations. See :doc:`/reference/contrib/forms/customisation` (Mikalai Radchuk)
2016-12-09 16:43:53 +01:00
Bug fixes
~~~~~~~~~
2017-01-05 18:29:43 +01:00
* Help text for StreamField is now visible and does not cover block controls (Stein Strindhaug)
* "X minutes ago" timestamps are now marked for translation (Janneke Janssen, Matt Westcott)
2017-01-24 17:07:16 +01:00
* Avoid indexing unsaved field content on `save(update_fields=[...])` operations (Matt Westcott)
2016-12-09 16:43:53 +01:00
Upgrade considerations
======================
``get_context`` methods on StreamField blocks need updating
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Previously, ``get_context`` methods on StreamField blocks returned a dict of variables which would be merged into the calling template's context before rendering the block template. ``get_context`` methods now receive a ``parent_context`` dict, and are responsible for returning the final context dictionary with any new variables merged into it. The old calling convention is now deprecated, and will be phased out in Wagtail 1.11.
In most cases, the method will be calling ``get_context`` on the superclass, and can be updated by passing the new ``parent_context`` keyword argument to it:
.. code-block:: python
class MyBlock(Block):
def get_context(self, value):
context = super(MyBlock, self).get_context(value)
...
return context
becomes:
.. code-block:: python
class MyBlock(Block):
def get_context(self, value, parent_context=None):
context = super(MyBlock, self).get_context(value, parent_context=parent_context)
...
return context
Note that ``get_context`` methods on page models are unaffected by this change.