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

Attaching a cloneable multi selection custom field with custom field choices breaks the Clone function #13909

Closed
eu-tomas opened this issue Sep 26, 2023 · 1 comment · Fixed by #14612
Assignees
Labels
severity: low Does not significantly disrupt application functionality, or a workaround is available status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@eu-tomas
Copy link

NetBox version

v3.6.3

Python version

3.9

Steps to Reproduce

  1. Create a custom field choices object without base choices selected and with at least 1 extra choice defined.
  2. Create a custom field of the type "Multiple Selection" and associate with a content type (I used Virtual Machine, but the problem also appears for all other object types I've tested with such as IP addresses).
  3. Use the previously created custom field choices object as "Choice Set".
  4. Select the "Is cloneable" checkbox.
  5. Go to any object of the associated content type and try to clone it. It doesn't matter if the custom field has been provided with a value for that object or not.
  6. Cloning will fail with the message <class 'TypeError'> 'in <string>' requires string as left operand, not NoneType
  7. Disable the "Is cloneable" checkbox in the custom field that was created in step 2.
  8. Cloning the object will now work (but obviously without cloning the custom field).

Expected Behavior

I would expect the object to be cloneable when I use custom fields of the multiple selection type with the cloneable option enabled.

Observed Behavior

<class 'TypeError'>'in <string>' requires string as left operand, not NoneType occurs whenever trying to clone any object that uses a multiple selection custom field where "is cloneable" is enabled.

This worked fine in 3.5.9, so it seems it is probably related to the new custom field choices object introduced in 3.6.0.

The workaround for now is to disable "is cloneable" on all multiple selection custom fields until the cause of the error is fixed.

@eu-tomas eu-tomas added the type: bug A confirmed report of unexpected behavior in the application label Sep 26, 2023
@abhi1693 abhi1693 added status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation severity: low Does not significantly disrupt application functionality, or a workaround is available labels Sep 27, 2023
@yash-pal1
Copy link
Contributor

can you pleas assign this task to me.

@abhi1693 abhi1693 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 Sep 29, 2023
yash-pal1 added a commit to Onemind-Services-LLC/netbox that referenced this issue Sep 29, 2023
yash-pal1 added a commit to Onemind-Services-LLC/netbox that referenced this issue Sep 29, 2023
@yash-pal1 yash-pal1 removed their assignment Oct 31, 2023
@jeremystretch jeremystretch self-assigned this Dec 27, 2023
jeremystretch added a commit that referenced this issue Dec 27, 2023
jeremystretch added a commit that referenced this issue Dec 27, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
severity: low Does not significantly disrupt application functionality, or a workaround is available status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
4 participants