google-code-export / django-grappelli

Automatically exported from code.google.com/p/django-grappelli
0 stars 0 forks source link

sortable inline submit problem #23

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When using a sortable inline with the requisite order field (as one of
several inlines for the same model) and submitting with nothing added for
that inline, I get an error message for required fields in that inline. 
The sortable feature, therefore, is broken.  (And if I take sortable=True
out of the admin class, the "order" field is still not displayed, so manual
ordering isn't possible either.)

I will be looking to fix this if I have time in the next week, and will
submit a patch if so.  But any help would be appreciated.

Original issue reported on code.google.com by jsmull...@gmail.com on 3 Mar 2009 at 9:19

GoogleCodeExporter commented 9 years ago
The attached one-line patch fixes the problem for me.  

Original comment by jsmull...@gmail.com on 9 Mar 2009 at 9:29

Attachments:

GoogleCodeExporter commented 9 years ago
I can´t reproduce this error. the line your are referring to is already within 
a loop
over all inline-related ...

maybe I´m missing something, but it works for me.

Original comment by sehmaschine on 12 Mar 2009 at 2:43

GoogleCodeExporter commented 9 years ago
I don't know the reason, but setting the value of the order input with val('') 
is
setting the javascript property "value" without affecting what actually gets
submitted by the form (or what is returned by getAttribute('value'), for that
matter).  That behavior is surprising to me, but I can reproduce it.   If you 
want to
see the bug in action, send me an email and I can arrange that.

Original comment by jsmull...@gmail.com on 12 Mar 2009 at 3:03

GoogleCodeExporter commented 9 years ago
this means that you are not able to submit a form with empty inlines, right?
what´s your email-address?

Original comment by sehmaschine on 12 Mar 2009 at 4:21

GoogleCodeExporter commented 9 years ago
Yes, that is what I mean.  jsmullyan @ gmail.

Original comment by jsmull...@gmail.com on 12 Mar 2009 at 5:06

GoogleCodeExporter commented 9 years ago
setting this to "fixed".

the problem is, that defining the default-attribute for the order-field 
doesn´t work
as expected. I´ve used the debug-toolbar to check all the values and the reset 
of the
value-fields is fine with the current javascript (the patch doesn´t change 
anything
here - it´s totally the same behaviour when it comes to "request vars").

therefore, the "fix" for this problem is to remove the default-attribute from 
the
order-field (i´ve change the docs accordingly).

thanks,
patrick

Original comment by sehmaschine on 13 Mar 2009 at 11:08