Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
FliesLikeABrick opened this issue Mar 8, 2023 · 4 comments · Fixed by #12014
Closed

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

FliesLikeABrick opened this issue Mar 8, 2023 · 4 comments · Fixed by #12014
Assignees
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@FliesLikeABrick
Copy link

FliesLikeABrick commented Mar 8, 2023

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

@FliesLikeABrick FliesLikeABrick added the type: bug A confirmed report of unexpected behavior in the application label Mar 8, 2023
@FliesLikeABrick
Copy link
Author

FliesLikeABrick commented 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 FliesLikeABrick changed the title Clone Saved Filters does not clone parameters Clone Saved Filters does not clone parameters+content types Mar 8, 2023
@FliesLikeABrick
Copy link
Author

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

@jeremystretch jeremystretch added the status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation label Mar 13, 2023
@arthanson arthanson self-assigned this Mar 20, 2023
@arthanson
Copy link
Collaborator

@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)?

@jeremystretch
Copy link
Member

Sure, if it can be accomplished reasonably.

@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation and removed status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation labels Mar 20, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants