Unable to add Power Port or Interface Templates to Module Type via WebUI #6989

Closed
opened 2025-12-29 19:47:31 +01:00 by adam · 3 comments
Owner

Originally created by @ZPrimed on GitHub (Sep 16, 2022).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v3.3.3

Python version

3.8

Steps to Reproduce

Using web interface:

  1. Create new Module Type
  2. Add Components -> Power Port
  3. "Module Type" defaults to the newly created Module Type, and Device Type is "------" (null?), but still has a "required" asterisk next to it and bold field name
  4. Click "Create"

Expected Behavior

Should be able to create Power Ports (and Interfaces) on Module Types. I believe this worked in the past, because I have existing Module Types (removable power supplies) that have Power Port Templates attached to them already, and I'm pretty sure I defined those Module Types by hand with the GUI (not with YAML import).

I'm not sure when this broke, as I haven't attempted to create a new Module Type in a while.

I have also not attempted to do this task with the API to see if that avoids the problem (we aren't really using it, yet).

Observed Behavior

Not able to create Power Port (or Interface) associated with a Module Type rather than a Device Type - form is requiring that a Device Type be selected.

On a whim, tried selecting both a Device Type and the Module Type, and got the error:

A component template cannot be associated with both a device type and a module type.

Originally created by @ZPrimed on GitHub (Sep 16, 2022). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v3.3.3 ### Python version 3.8 ### Steps to Reproduce Using web interface: 1. Create new Module Type 2. Add Components -> Power Port 3. "Module Type" defaults to the newly created Module Type, and Device Type is "------" (null?), but still has a "required" asterisk next to it and bold field name 4. Click "Create" ### Expected Behavior Should be able to create Power Ports (and Interfaces) on Module Types. I believe this worked in the past, because I have existing Module Types (removable power supplies) that have Power Port Templates attached to them already, and I'm pretty sure I defined those Module Types by hand with the GUI (not with YAML import). I'm not sure when this broke, as I haven't attempted to create a new Module Type in a while. I have also **not** attempted to do this task with the API to see if that avoids the problem (we aren't really using it, yet). ### Observed Behavior Not able to create Power Port (or Interface) associated with a Module Type rather than a Device Type - form is requiring that a Device Type be selected. On a whim, tried selecting both a Device Type and the Module Type, and got the error: > A component template cannot be associated with both a device type and a module type.
adam added the type: bugstatus: accepted labels 2025-12-29 19:47:31 +01:00
adam closed this issue 2025-12-29 19:47:31 +01:00
Author
Owner

@ZPrimed commented on GitHub (Sep 16, 2022):

Hmm, just attempted to reproduce on demo.netbox.dev and the form is slightly different... I literally just updated our instance to v3.3.3 about 15 minutes before trying this and found the bug then.

I was thinking this was a browser cache issue, but then I popped an incognito window and am seeing the same form (via incognito) as I'm seeing in a normal window.

Here's my local instance's form:
netbox-moduletype-powerport-form

And here's the demo, which I just noticed is still on v3.3.2:
netbox-demo-module-type-port-template

So now I'm thinking it's a regression in v3.3.3?
[edit] Confirmed. Rolled back to v3.3.2 and the form works correctly again.

@ZPrimed commented on GitHub (Sep 16, 2022): Hmm, just attempted to reproduce on demo.netbox.dev and the form is slightly different... I literally just updated our instance to v3.3.3 about 15 minutes before trying this and found the bug then. I *was* thinking this was a browser cache issue, but then I popped an incognito window and am seeing the same form (via incognito) as I'm seeing in a normal window. Here's my local instance's form: ![netbox-moduletype-powerport-form](https://user-images.githubusercontent.com/4011850/190528447-b26abea5-d446-4902-882a-e391b4bc48ac.jpg) And here's the demo, which I just noticed is still on v3.3.2: ![netbox-demo-module-type-port-template](https://user-images.githubusercontent.com/4011850/190528569-4b13e5fa-971b-492c-b178-3fb19860ea1d.jpg) So now I'm thinking it's a regression in v3.3.3? [edit] Confirmed. Rolled back to v3.3.2 and the form works correctly again.
Author
Owner

@jeremystretch commented on GitHub (Sep 16, 2022):

So now I'm thinking it's a regression in v3.3.3?

Yeah, this was my mistake. The device_type field should not be required on the component template forms. This was a regression under #10247.

@jeremystretch commented on GitHub (Sep 16, 2022): > So now I'm thinking it's a regression in v3.3.3? Yeah, this was my mistake. The `device_type` field should not be required on the component template forms. This was a regression under #10247.
Author
Owner

@ZPrimed commented on GitHub (Sep 16, 2022):

@jeremystretch just wanted to follow up on this, 3.3.4 does work as expected, I appreciate the very rapid fix!

Was it intended for the UI on that page to change to show both dropdowns all the time (Device Type and Module Type)?

I actually thought the 3.3.2 interface was nice, with the sort of "tabbed" layout to switch between Device Type and Module Type. But if this was changed to improve keyboard navigation or something else, that's understandable too.

@ZPrimed commented on GitHub (Sep 16, 2022): @jeremystretch just wanted to follow up on this, 3.3.4 does work as expected, I appreciate the very rapid fix! Was it intended for the UI on that page to change to show both dropdowns all the time (Device Type and Module Type)? I actually thought the 3.3.2 interface was nice, with the sort of "tabbed" layout to switch between Device Type and Module Type. But if this was changed to improve keyboard navigation or something else, that's understandable too.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6989