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

Attached a clonable field multi selection, bug fixes #13935

Conversation

yash-pal1
Copy link
Contributor

Fixes: #13909

@@ -43,7 +43,7 @@ def get_bound_field(self, form, field_name):

if data is not None:
self.choices = [
choice for choice in self.choices if choice[0] in data
choice for choice in self.choices if isinstance(self.choices, str) if choice[0] in data
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
choice for choice in self.choices if isinstance(self.choices, str) if choice[0] in data
choice for choice in self.choices if isinstance(self.choices, str) and choice[0] in data

I think and should suffice here

Copy link
Member

@jeremystretch jeremystretch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this avoids the exception, it doesn't actually fix the cloning functionality. The new form should be pre-populated with the custom field value(s) from the object being cloned.

@jeremystretch
Copy link
Member

@yash-pal1 are you still interested in working on this?

@yash-pal1
Copy link
Contributor Author

yash-pal1 commented Oct 30, 2023

@yash-pal1 are you still interested in working on this?

trying to fix this, so sorry for not active on this issue

@jeremystretch
Copy link
Member

Closing for inactivity. Please see #14612 for a (very similar) alternative fix.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Attaching a cloneable multi selection custom field with custom field choices breaks the Clone function
3 participants