Position field not populating for Module Bay bulk creation #6710

Closed
opened 2025-12-29 19:44:21 +01:00 by adam · 6 comments
Owner

Originally created by @sleepinggenius2 on GitHub (Jul 22, 2022).

Originally assigned to: @sleepinggenius2 on GitHub.

NetBox version

v3.2.7

Python version

3.8

Steps to Reproduce

  1. Select one or more devices from the Devices list
  2. Click on Add Components > Module Bays
  3. Enter "Test" in the Name field
  4. Enter "1" in the Position field
  5. Click Create
  6. Open one of the previously selected devices
  7. Click on the Module Bays tab
  8. Observe that the bay named "Test" does not have a Position value

Expected Behavior

The Position field on bulk-created Module Bays should be populated with the entered value.

Issue #9194 was resolved to add the field in the UI, but does not appear to have been wired up correctly in the backend. I have added some additional comments on that issue around what I believe is the problem and I have code prepared to create a PR to resolve.

Observed Behavior

The Position field is blank and no error is given.

Originally created by @sleepinggenius2 on GitHub (Jul 22, 2022). Originally assigned to: @sleepinggenius2 on GitHub. ### NetBox version v3.2.7 ### Python version 3.8 ### Steps to Reproduce 1. Select one or more devices from the Devices list 2. Click on Add Components > Module Bays 3. Enter "Test" in the *Name* field 4. Enter "1" in the *Position* field 5. Click *Create* 6. Open one of the previously selected devices 7. Click on the *Module Bays* tab 8. Observe that the bay named "Test" does not have a *Position* value ### Expected Behavior The *Position* field on bulk-created Module Bays should be populated with the entered value. Issue #9194 was resolved to add the field in the UI, but does not appear to have been wired up correctly in the backend. I have added some additional comments on that issue around what I believe is the problem and I have code prepared to create a PR to resolve. ### Observed Behavior The *Position* field is blank and no error is given.
adam added the type: bugstatus: accepted labels 2025-12-29 19:44:21 +01:00
adam closed this issue 2025-12-29 19:44:21 +01:00
Author
Owner

@DanSheps commented on GitHub (Jul 24, 2022):

I am not able to replicate this behaviour on the current 3.2.7 on either a local instance or the demo instance.

I would suggest you:

  • Dump your browser cache
  • Collect static
  • Ensure all files are properly up-to-date

If that fails, I would suggest trying a re-installation from master.

@DanSheps commented on GitHub (Jul 24, 2022): I am not able to replicate this behaviour on the current 3.2.7 on either a local instance or the demo instance. I would suggest you: * Dump your browser cache * Collect static * Ensure all files are properly up-to-date If that fails, I would suggest trying a re-installation from master.
Author
Owner

@sleepinggenius2 commented on GitHub (Jul 24, 2022):

@DanSheps Maybe my instructions weren't clear. Are you sure you are doing the bulk creation from the device list screen? I have tried this on every instance I have access to, including the demo, and am able to replicate this.

I just replicated it on the demo instance as follows:

  1. Click on Devices > Devices from the sidebar menu
  2. Click the checkbox next to dmi01-buffalo-sw01 in the Devices list
  3. Scroll to the bottom of the page and click on the Add Components dropdown and select Module Bays
  4. Enter "Test" in the Name field
  5. Enter "1" in the Position field
  6. Click on the Create button
  7. Click on dmi01-buffalo-sw01 in the Devices list
  8. Click on the Module Bays tab
  9. The Position field for the Test bay is empty
@sleepinggenius2 commented on GitHub (Jul 24, 2022): @DanSheps Maybe my instructions weren't clear. Are you sure you are doing the bulk creation from the device list screen? I have tried this on every instance I have access to, including the demo, and am able to replicate this. I just replicated it on the demo instance as follows: 1. Click on Devices > Devices from the sidebar menu 2. Click the checkbox next to dmi01-buffalo-sw01 in the Devices list 3. Scroll to the bottom of the page and click on the Add Components dropdown and select Module Bays 4. Enter "Test" in the Name field 5. Enter "1" in the Position field 6. Click on the Create button 7. Click on dmi01-buffalo-sw01 in the Devices list 8. Click on the Module Bays tab 9. The Position field for the Test bay is empty
Author
Owner

@jeremystretch commented on GitHub (Jul 26, 2022):

The issue is that BulkComponentCreateView only supports expansion for the name_pattern and label_pattern fields.

@jeremystretch commented on GitHub (Jul 26, 2022): The issue is that BulkComponentCreateView only supports expansion for the `name_pattern` and `label_pattern` fields.
Author
Owner

@sleepinggenius2 commented on GitHub (Jul 26, 2022):

That was the conclusion I had come to as well. I have code ready to submit for a PR, if you would like me to do so.

@sleepinggenius2 commented on GitHub (Jul 26, 2022): That was the conclusion I had come to as well. I have code ready to submit for a PR, if you would like me to do so.
Author
Owner

@jeremystretch commented on GitHub (Jul 26, 2022):

@sleepinggenius2 this will need to be addressed in a scalable fashion, to ensure we don't run into a similar problem in the future. (E.g. we can't hard-code the position_pattern field into the view class.) If you're up for it, you're welcome to submit a PR.

@jeremystretch commented on GitHub (Jul 26, 2022): @sleepinggenius2 this will need to be addressed in a scalable fashion, to ensure we don't run into a similar problem in the future. (E.g. we can't hard-code the `position_pattern` field into the view class.) If you're up for it, you're welcome to submit a PR.
Author
Owner

@sleepinggenius2 commented on GitHub (Jul 26, 2022):

Yes, I implemented it using a patterned_fields class attribute for consistency with the non-bulk implementation. I will submit a PR.

@sleepinggenius2 commented on GitHub (Jul 26, 2022): Yes, I implemented it using a patterned_fields class attribute for consistency with the non-bulk implementation. I will submit a PR.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6710