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

Closed
opened 2025-12-29 20:39:47 +01:00 by adam · 1 comment
Owner

Originally created by @eu-tomas on GitHub (Sep 26, 2023).

Originally assigned to: @jeremystretch on GitHub.

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.

Originally created by @eu-tomas on GitHub (Sep 26, 2023). Originally assigned to: @jeremystretch on GitHub. ### 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.
adam added the type: bugstatus: acceptedseverity: low labels 2025-12-29 20:39:47 +01:00
adam closed this issue 2025-12-29 20:39:47 +01:00
Author
Owner

@yash-pal1 commented on GitHub (Sep 29, 2023):

can you pleas assign this task to me.

@yash-pal1 commented on GitHub (Sep 29, 2023): can you pleas assign this task to me.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8679