Wrong redirect url for module components creation #6538

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

Originally created by @marinakosolap on GitHub (Jun 6, 2022).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v3.2.4

Python version

3.8

Steps to Reproduce

  1. Create module
  2. Go to module and click add component
  3. Create some component

https://user-images.githubusercontent.com/46861251/172150867-9d59563b-e580-41ea-98de-5b55c8f0d8f7.mov

Expected Behavior

After module component creation page with module components is opened

Observed Behavior

After module component creation page with device components is opened (if there is device with such id (module id). In other case there is an error that such page wasn't found)
image

Originally created by @marinakosolap on GitHub (Jun 6, 2022). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v3.2.4 ### Python version 3.8 ### Steps to Reproduce 1. Create module 2. Go to module and click add component 3. Create some component https://user-images.githubusercontent.com/46861251/172150867-9d59563b-e580-41ea-98de-5b55c8f0d8f7.mov ### Expected Behavior After module component creation page with module components is opened ### Observed Behavior After module component creation page with device components is opened (if there is device with such id (module id). In other case there is an error that such page wasn't found) <img width="889" alt="image" src="https://user-images.githubusercontent.com/46861251/172151296-883689dd-67f6-4a90-87ec-86c76fce0365.png">
adam added the type: bugstatus: accepted labels 2025-12-29 19:42:07 +01:00
adam closed this issue 2025-12-29 19:42:07 +01:00
Author
Owner

@kkthxbye-code commented on GitHub (Jun 6, 2022):

The returnurl is indeed set to return to the pk of the module instead of the pk of the modules device, which is a bug.

3fbf1f7e71/netbox/templates/dcim/module.html (L21)

Not sure if I understand what you mean by:

Expected Behavior

After module component creation page with module components is opened

Could you specify or just give an example of the URL you want to be the return?

Fixing the bug would return to the same view as before, just on the right device. I'm not totally sure it is better to return to the module (if that is indeed what you are suggesting).

@kkthxbye-code commented on GitHub (Jun 6, 2022): The returnurl is indeed set to return to the pk of the module instead of the pk of the modules device, which is a bug. https://github.com/netbox-community/netbox/blob/3fbf1f7e71801487abd3524797298d82dca4db4f/netbox/templates/dcim/module.html#L21 Not sure if I understand what you mean by: > #### Expected Behavior > After module component creation page with module components is opened Could you specify or just give an example of the URL you want to be the return? Fixing the bug would return to the same view as before, just on the right device. I'm not totally sure it is better to return to the module (if that is indeed what you are suggesting).
Author
Owner

@marinakosolap commented on GitHub (Jun 6, 2022):

So, I suppose that when we add console port to module we should show console ports of this module.
Something like this - https://demo.netbox.dev/dcim/console-ports/?module_id=1

@marinakosolap commented on GitHub (Jun 6, 2022): So, I suppose that when we add console port to module we should show console ports of this module. Something like this - https://demo.netbox.dev/dcim/console-ports/?module_id=1
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6538