#36331: Object tools moved out of content block
-------------------------------+--------------------------------------
Reporter: Fabian Braun | Owner: (none)
Type: Bug | Status: new
Component: contrib.admin | Version: 5.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Description changed by Fabian Braun:
Old description:
> 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.
New description:
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** in commit
`abe925ff0bec2db8cd6247397327889d5f1a7f7c`:
* 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#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/django-updates/01070196409e4f00-8cb67cfc-2e3b-4a09-9a6a-6064764a4395-000000%40eu-central-1.amazonses.com.