add interface/port buttons missing on device type #462

Closed
opened 2025-12-29 16:22:24 +01:00 by adam · 4 comments
Owner

Originally created by @bleything on GitHub (Oct 2, 2016).

In v1.6.2 the Add Interface/Console Port/etc links are missing from the device type show page. Here's what I am seeing:

screenshot 2016-10-02 13 57 24

And here's what I'm pretty sure I'm meant to be seeing:

screenshot 2016-10-02 13 57 45

Through the magic of git bisect I have identified 30c7c2d359 as the commit which broke this. It looks like it's the conditional on line 8 of netbox/templates/dcim/inc/devicetype_component_table.html... if I remove that conditional block, I get the buttons back.

I'm guessing that the idea there was to make that button disappear if there were between one and ten rows in the table and then reappear if there were ten or more. If that's right, then I think that changing it to {% if table.rows|length > 10 or table.rows|length == 0 %} will do the trick. I can submit a PR if y'all want.

Originally created by @bleything on GitHub (Oct 2, 2016). In v1.6.2 the Add Interface/Console Port/etc links are missing from the device type show page. Here's what I am seeing: ![screenshot 2016-10-02 13 57 24](https://cloud.githubusercontent.com/assets/270/19023644/59784552-88a8-11e6-877b-15531bf5d35e.png) And here's what I'm pretty sure I'm meant to be seeing: ![screenshot 2016-10-02 13 57 45](https://cloud.githubusercontent.com/assets/270/19023647/6256b424-88a8-11e6-889b-e32d05c40486.png) Through the magic of git bisect I have identified 30c7c2d359f59165093274d6f560bbce1a62f1da as the commit which broke this. It looks like it's the [conditional on line 8 of `netbox/templates/dcim/inc/devicetype_component_table.html`](https://github.com/digitalocean/netbox/commit/30c7c2d359f59165093274d6f560bbce1a62f1da#diff-9bd2b5a22068ed7c8f53e931cc5ebf98R8)... if I remove that conditional block, I get the buttons back. I'm guessing that the idea there was to make that button disappear if there were between one and ten rows in the table and then reappear if there were ten or more. If that's right, then I think that changing it to `{% if table.rows|length > 10 or table.rows|length == 0 %}` will do the trick. I can submit a PR if y'all want.
adam added the type: bug label 2025-12-29 16:22:24 +01:00
adam closed this issue 2025-12-29 16:22:24 +01:00
Author
Owner

@therealjoshuad commented on GitHub (Oct 3, 2016):

I just noticed that I'm getting the same behavior.

@therealjoshuad commented on GitHub (Oct 3, 2016): I just noticed that I'm getting the same behavior.
Author
Owner

@jeremystretch commented on GitHub (Oct 3, 2016):

Derp. I'll try to get a fix out today. Thanks for catching this!

@jeremystretch commented on GitHub (Oct 3, 2016): Derp. I'll try to get a fix out today. Thanks for catching this!
Author
Owner

@jeremystretch commented on GitHub (Oct 4, 2016):

This has been fixed in release v1.6.2-r1. Still need to apply the patch to the develop branch.

@jeremystretch commented on GitHub (Oct 4, 2016): This has been fixed in [release v1.6.2-r1](https://github.com/digitalocean/netbox/releases/tag/v1.6.2-r1). Still need to apply the patch to the `develop` branch.
Author
Owner

@bleything commented on GitHub (Oct 7, 2016):

Great! Thank you so much 😀

@bleything commented on GitHub (Oct 7, 2016): Great! Thank you so much :grinning:
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#462