Clone Saved Filters does not clone parameters+content types #7738

Closed
opened 2025-12-29 20:27:40 +01:00 by adam · 4 comments
Owner

Originally created by @FliesLikeABrick on GitHub (Mar 8, 2023).

Originally assigned to: @arthanson on GitHub.

NetBox version

3.4.5

Python version

3.10

Steps to Reproduce

  1. Browse to /extras/saved-filters with at least one saved filter defined
  2. Browse into a filter's details and select "Clone"
  3. Observe that the prepared filter does not have the key fields "content types" and "parameters" populated

Expected Behavior

A cloned filter should inherit/copy the "content types" and "parameters" fields from the filter being cloned, as these are the defining characteristics of the filter's behavior

Observed Behavior

The only field copied from the existing filter is "weight"; the fields of primary value for defining (and therefore cloning to edit) a filter are "content types" and parameters

Originally created by @FliesLikeABrick on GitHub (Mar 8, 2023). Originally assigned to: @arthanson on GitHub. ### NetBox version 3.4.5 ### Python version 3.10 ### Steps to Reproduce 1. Browse to /extras/saved-filters with at least one saved filter defined 2. Browse into a filter's details and select "Clone" 4. Observe that the prepared filter does not have the key fields "content types" and "parameters" populated ### Expected Behavior A cloned filter should inherit/copy the "content types" and "parameters" fields from the filter being cloned, as these are the defining characteristics of the filter's behavior ### Observed Behavior The only field copied from the existing filter is "weight"; the fields of primary value for defining (and therefore cloning to edit) a filter are "content types" and parameters
adam added the type: bugstatus: accepted labels 2025-12-29 20:27:40 +01:00
adam closed this issue 2025-12-29 20:27:41 +01:00
Author
Owner

@FliesLikeABrick commented on GitHub (Mar 8, 2023):

This is similar to what was reported in #11496 but that seemed to have some necessary information added after it was closed.
#11914 is open for cloned filter "export" having a similar issue, where the key field "parameters" is not being exported.
As you may see in a trend between these two - we are trying to create many similar filters and both of these behaviors make it awkward to do so (without manually copying/pasting/modifying the JSON "parameters" in Excel to create a csv for import)

@FliesLikeABrick commented on GitHub (Mar 8, 2023): This is similar to what was reported in #11496 but that seemed to have some necessary information added after it was closed. #11914 is open for cloned filter "export" having a similar issue, where the key field "parameters" is not being exported. As you may see in a trend between these two - we are trying to create many similar filters and both of these behaviors make it awkward to do so (without manually copying/pasting/modifying the JSON "parameters" in Excel to create a csv for import)
Author
Owner

@FliesLikeABrick commented on GitHub (Mar 8, 2023):

With a little bit of pointers towards the right part of the code base, I'm happy to open a PR for this.

@FliesLikeABrick commented on GitHub (Mar 8, 2023): With a little bit of pointers towards the right part of the code base, I'm happy to open a PR for this.
Author
Owner

@arthanson commented on GitHub (Mar 20, 2023):

@jeremystretch the content_types is an M2M field which CloningMixin.clone doesn't look like it handles. Would this be something we'd want to add support for (ability to clone M2M fields)?

@arthanson commented on GitHub (Mar 20, 2023): @jeremystretch the content_types is an M2M field which CloningMixin.clone doesn't look like it handles. Would this be something we'd want to add support for (ability to clone M2M fields)?
Author
Owner

@jeremystretch commented on GitHub (Mar 20, 2023):

Sure, if it can be accomplished reasonably.

@jeremystretch commented on GitHub (Mar 20, 2023): Sure, if it can be accomplished reasonably.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#7738