Unreleased
---
local:
depth: 1
---
WAGTAIL_DATE_FORMAT
, WAGTAIL_DATETIME_FORMAT
, WAGTAIL_TIME_FORMAT
are correctly configured (Rohit Sharma, Coen van der Kamp)IndexView
using the generic.IndexView
(Rohit Sharma, Sage Abdullah, Storm Heg)PageListingViewSet
for custom per-page-type page listings (Matt Westcott)AbstractGroupApprovalTask
to simplify customizing behavior of custom Task
models (John-Scott Atlakson)djangorestframework
to 3.15.1 (Sage Abdullah)IndexView.list_display
(Abdelrahman Hamada)Page.route_for_request()
to find the page route,
and Page.find_for_request()
to find the page given a request object and a URL path. Results are cached on request._wagtail_route_for_request
(Gordon Pendleton)__str__
for MySQL search index (Jake Howard)date
objects on human_readable_date
template tag (Jhonatan Lopes)verbose_name
in group edit view when listing custom permissions (Sage Abdullah, Neeraj Yetheendran, Omkar Jadhav)make livehtml
(Sage Abdullah)LANGUAGE_CODE
(Mark Niehues)UnsavedController
checks for nested removal/additions of inputs so that the unsaved warning shows in more valid cases when editing a page (Karthik Ayangar)get_add_url()
is always used to re-render the add button when the listing is refreshed in viewsets (Sage Abdullah)objects
manager (Jhonatan Lopes)get_dummy_request
's resulting host name when running tests with ALLOWED_HOSTS = ["*"]
(David Buxton)timesince_last_update
template tag (Matt Westcott)--purge-only
in wagtail_update_image_renditions
management command section (Pranith Beeram)6.3.0
with a fix for the missing favicon (Sage Abdullah)wagtail_update_image_renditions
management command on the using images page (LB (Ben) Johnston)html.parser
(Jake Howard)html.parser
& remove html5lib
dependency (Jake Howard)Button
that only renders links (a element) to Link
and remove unused prop & behaviors that was non-compliant for aria role usage (Advik Kabra)wagtail.models.AbstractWorkflow
model to support future customizations around workflows (Hossein)classnames
template tag to handle nested lists of strings, use template tag for admin body
element (LB (Ben) Johnston)UploadedDocument
and UploadedImage
into new UploadedFile
model for easier shared code usage (Advik Kabra, Karl Hobley)window.chooserUrls
globals, removing the need for inline scripts (Elhussein Almasri)w-init
(InitController) to support a detail
value to be dispatched on events (Chiemezuo Akujobi)page_breadcrumbs
tag to use shared breadcrumbs.html
template (Sage Abdullah)keyboard
icon to admin icon set (Rohit Sharma)SwapController
(LB (Ben) Johnston)w-block
/BlockController
) to instantiate StreamField
blocks (Karthik Ayangar)w-kbd
/KeyboardController
) (Neeraj Yetheendran)SubmissionsListView
classAs part of the Universal Listings project, the SubmissionsListView
for listing form submissions in the wagtail.contrib.forms
app has been refactored to become a subclass of wagtail.admin.views.generic.base.BaseListingView
. As a result, the class has undergone a number of changes, including the following:
ordering
attribute has been renamed to default_ordering
.register_user_listing_buttons
hook signature changedThe function signature for the register_user_listing_buttons
hook was updated to accept a request_user
argument instead of context
. If you use this hook, make sure to update your function signature to match the new one. The old signature with context
will continue to work for now, but the context only contains the request object. Support for the old signature will be removed in a future release.
user_listing_buttons
template tagThe undocumented user_listing_buttons
template tag has been deprecated and will be removed in a future release.
wagtailusers_groups:users
URL patternThe undocumented wagtailusers_groups:users
URL pattern has been deprecated and will be removed in a future release. If you are using reverse
with this URL pattern name, you should update your code to use the wagtailusers_users:index
URL pattern name and the group ID as the group
query parameter. For example:
reverse('wagtailusers_groups:users', args=[group.id])
should be updated to:
reverse('wagtailusers_users:index') + f'?group={group.id}'
The corresponding wagtailusers_groups:users_results
URL pattern has been removed as part of this change.
A redirect from the old URL pattern to the new one has been added to ensure that existing URLs continue to work. This redirect will be removed in a future release.
window.chooserUrls
within Draftail choosersThe undocumented usage of the JavaScript window.chooserUrls
within Draftail choosers will be removed in a future release.
The following chooserUrl
object values will be impacted.
anchorLinkChooser
documentChooser
emailLinkChooser
embedsChooser
externalLinkChooser
imageChooser
pageChooser
Overriding these inner values on the global window.chooserUrls
object will still override their usage in the Draftail choosers for now but this capability will be removed in a future release.
It's recommended that usage of this global is removed in any customizations or third party packages and instead a custom Draftail Entity be used instead. See example below.
# .../wagtail_hooks.py
@hooks.register("insert_editor_js")
def editor_js():
return format_html(
"""
<script>
window.chooserUrls.myCustomChooser = '{0}';
</script>
""",
reverse("myapp_chooser:choose"),
)
Remove the insert_editor_js
hook usage and instead pass the data needed via the Entity's data.
# .../wagtail_hooks.py
from django.urls import reverse_lazy
@hooks.register("register_rich_text_features")
def register_my_custom_feature(features):
# features.register_link_type...
features.register_editor_plugin(
"draftail",
"custom-link",
draftail_features.EntityFeature(
{
"type": "CUSTOM_ITEM",
"icon": "doc-full-inverse",
"description": gettext_lazy("Item"),
"chooserUrls": {
# Important: `reverse_lazy` must be used unless the URL path is hard-coded
"myChooser": reverse_lazy("myapp_chooser:choose")
},
},
js=["..."],
),
)
chooserUrls
valuesTo override existing chooser Entities' chooserUrls
values, here is an example of an unsupported monkey patch can achieve a similar goal.
However, it's recommended that a custom Entity be created to be registered as a replacement feature for Draftail customizations as per the documentation.
# .../wagtail_hooks.py
from django.urls import reverse_lazy
from wagtail import hooks
@hooks.register("register_rich_text_features")
def override_embed_feature_url(features):
features.plugins_by_editor["draftail"]["embed"].data["chooserUrls"]["embedsChooser"] = reverse_lazy("my_embeds:chooser")
window.initBlockWidget
to initialize a StreamField blockThe undocumented global function window.initBlockWidget
has now been deprecated and will be removed in a future release.
Any complex customizations that have re-implemented parts of this functionality will need to be modified to adopt the new approach that uses Stimulus and avoids inline scripts.
The usage of this new approach is still unofficial and could change in the future, it's recommended that the documented BlockWidget
and StreamField
approaches be used instead.
However, for comparison, here is the old and new approach below.
Assuming we are using Django's format_html
to prepare the HTML output with JSON.dumps
strings for the block data values.
The old approach would call the window.initBlockWidget
global function with an inline script as follows:
<div
id="{id}"
data-block="{block_json}"
data-value="{value_json}"
data-error="{error_json}"
></div>
<script>
initBlockWidget('{id}');
</script>
In the new approach, we no longer need to attach an inline script but instead use the Stimulus data attributes to attach the behavior with the w-block
identifier as follows:
<div
id="{id}"
data-block
data-controller="w-block"
data-w-block-data-value="{block_json}"
data-w-block-arguments-value="[{value_json},{error_json}]"
></div>