Unreleased
---
local:
depth: 1
---
WAGTAIL_DATE_FORMAT
, WAGTAIL_DATETIME_FORMAT
, WAGTAIL_TIME_FORMAT
are correctly configured (Rohit Sharma, Coen van der Kamp)__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)--purge-only
in wagtail_update_image_renditions
management command section (Pranith)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 customisations 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)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 customisations 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 customisations 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")