Delete modal doesn't work on some pages #5914

Closed
opened 2025-12-29 19:34:11 +01:00 by adam · 2 comments
Owner

Originally created by @kkthxbye-code on GitHub (Jan 10, 2022).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v3.1.6-dev

Python version

3.9

Steps to Reproduce

  1. Create a device
  2. Create interface
  3. View device under the interface tab
  4. Press delete

Expected Behavior

Delete modal pops up

Observed Behavior

Nothing happens.

Cause: #8231

The reason is that some tabs already define the modal block in their template:

f1472d218e/netbox/templates/dcim/device/interfaces.html (L82-L84)

Changing it to:

{% block modals %}
  {% include 'inc/htmx_modal.html' %}
  {% table_config_form table %}
{% endblock modals %}

fixes the issue. When the tabs templates define the modal, they don't get the default modal defined in generic/object.html

This is an issue in all templates that overwrite the modals block and use the htmx modal.

Examples:

  • dcim/device/interfaces.html
  • dcim/device/frontports.html
  • dcim/device/rearports.html
  • dcim/device/consoleports.html

etc.

Originally created by @kkthxbye-code on GitHub (Jan 10, 2022). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v3.1.6-dev ### Python version 3.9 ### Steps to Reproduce 1. Create a device 2. Create interface 3. View device under the interface tab 4. Press delete ### Expected Behavior Delete modal pops up ### Observed Behavior Nothing happens. Cause: #8231 The reason is that some tabs already define the modal block in their template: https://github.com/netbox-community/netbox/blob/f1472d218e157160306e7007fb3a705208901a71/netbox/templates/dcim/device/interfaces.html#L82-L84 Changing it to: ```python {% block modals %} {% include 'inc/htmx_modal.html' %} {% table_config_form table %} {% endblock modals %} ``` fixes the issue. When the tabs templates define the modal, they don't get the default modal defined in `generic/object.html` This is an issue in all templates that overwrite the modals block and use the htmx modal. Examples: * `dcim/device/interfaces.html` * `dcim/device/frontports.html` * `dcim/device/rearports.html` * `dcim/device/consoleports.html` etc.
adam added the type: bugstatus: accepted labels 2025-12-29 19:34:11 +01:00
adam closed this issue 2025-12-29 19:34:11 +01:00
Author
Owner

@kkthxbye-code commented on GitHub (Jan 10, 2022):

I guess you could actually just add {{ block.super }} to all the offending blocks. Not really sure what is best practice.

@kkthxbye-code commented on GitHub (Jan 10, 2022): I guess you could actually just add `{{ block.super }}` to all the offending blocks. Not really sure what is best practice.
Author
Owner

@jeremystretch commented on GitHub (Jan 10, 2022):

Yep, {{ block.super }} is the way to go. Good catch.

@jeremystretch commented on GitHub (Jan 10, 2022): Yep, `{{ block.super }}` is the way to go. Good catch.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5914