#36331: Object tools moved out of content block
------------------------------+-----------------------------------------
Reporter: Fabian Braun | Type: Bug
Status: new | Component: contrib.admin
Version: 5.2 | Severity: Normal
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+-----------------------------------------
In Django 5.2 the admin's `object-tools` block has been moved outside of
the `content` block in `django/contrib/admin/templates/admin/base.html` as
part of
https://github.com/django/django/pull/19032 fixing a layout issue.
Before Django 5.2:
{{{
...
{% block content_title %}{% if title %}<h1>{{ title }}</h1>{% endif
%}{% endblock %}
{% block content_subtitle %}{% if subtitle %}<h2>{{ subtitle }}</h2>{%
endif %}{% endblock %}
{% block content %}
{% block object-tools %}{% endblock %}
{{ content }}
{% endblock %}
...
}}}
Since Django 5.2:
{{{
...
{% block content_title %}{% if title %}<h1>{{ title }}</h1>{% endif
%}{% endblock %}
{% block object-tools %}{% endblock %}
{% block content_subtitle %}{% if subtitle %}<h2>{{ subtitle }}</h2>{%
endif %}{% endblock %}
{% block content %}
{{ content }}
{% endblock %}
...
}}}
This is a **breaking change**:
* Templates that overwrite the `content` block and contain an `object-
tools` block will have the object tools rendered twice (for example:
django-filer)
* Templates that overwrite the `content` block and do not contain an
`object-tools` block will have the default object-tools block rendered
instead of none. This can lead to exceptions and server errors 500.
The change is not documented, nor am I aware that it is intended.
--
Ticket URL: <
https://code.djangoproject.com/ticket/36331>
Django <
https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.