netbox-community / netbox

The premier source of truth powering network automation. Open source under Apache 2. Try NetBox Cloud free: https://netboxlabs.com/free-netbox-cloud/
http://netboxlabs.com/oss/netbox/
Apache License 2.0
16.15k stars 2.58k forks source link

Cloning DeviceType with 0U height doesn't work #16714

Closed llamafilm closed 4 months ago

llamafilm commented 4 months ago

Deployment Type

NetBox Cloud

NetBox Version

v4.0.5

Python Version

3.12

Steps to Reproduce

  1. Import any Device Type with 0U height (example)
  2. Clone it

Expected Behavior

The mandatory height field should be pre-filled with the number 0.

Observed Behavior

The height field is blank.

The Clone button URL is missing the number: https://localhost/dcim/device-types/add/?manufacturer=173&u_height=&is_full_depth=&airflow=right-to-left&weight=2.93&weight_unit=lb

jeffgdotorg commented 4 months ago

Thanks for the report @llamafilm. I've reproduced it in a fresh NetBox 4.0.6 instance and confirmed that hacking the a.href of the Clone button element to include u_height=0.0 results in the value carrying over to the Add form.

Moving along to needs owner status. If you or anybody else with the requisite skills and capacity would like to work it through to a PR, just chime in and a maintainer will assign the issue to you.

llamafilm commented 4 months ago

Looks like just one line, I can fix it

arthanson commented 4 months ago

I'll assign to you @llamafilm