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
Circular references makes it impossible to serialize ParsleyForm #1036
Comments
Actually, I'm not sure if there's anything simple we can do to simplify things for I'll comment further on |
I'm going to take a shot at avoiding cross-repository references, to centralize discussion. I see that Is there any time when the http://jsfiddle.net/jew1mg89/10/ I'm definitely not familiar enough with the Parsley internals to make a recommendation on how to avoid the circular references. But it does look like |
Parsley supports There's some other complications in that the options need to be restructured if an input is first initialized without a form and later bound via a form (see No offense intended, but I feel you are trying to fix the wrong problem. Using circular references is not an issue that needs resolving. Doing a naive deep clone on third party data is the issue. |
+1 |
Someone is going to look at the title of this and think: Why on earth would anyone want to serialize Parsley objects?
And that's where Select2 comes in. Specifically, the following ticket: select2/select2#4014 (comment)
Select2 uses
jQuery.extend
to clone the.data()
attached to an element. Because it recursively copies the data, this causes recursion issues when trying to clone theParsleyField
attached to the element. You can see this at the following jsfiddle: http://jsfiddle.net/jew1mg89/8/This is because
ParsleyField.parent
points toParsleyForm
. AndParsleyForm.fields
points to instances ofParsleyField
. I can't figure out why, becauseParsleyField.parent
is never actually used withinParsleyField
, and it even appears to be an optional attribute that won't always be present. It looks like it was introduced in 740ed31, and it might just be that the functionality that used it has since been removed.The text was updated successfully, but these errors were encountered: