This patch adds drag-n-drop reordering for multiple fields' values on node edit forms.
I attach it here as a way to reproduce the bug / test the patch on core's tabledrag.js mentioned in http://drupal.org/node/195073 (d-n-d only works for the last table to which the behavior has been attached).
Other than that, works pretty well. Still needs some minor polishing (css / cosmetics, plus hitting the 'add more values' wipes off the 'warning : changes not saved until the form is submitted' message issued by tabledrag)
I'm not committing this until a fix for the tabledrag bug gets into core.
How to test : add a few multiple fields to a content type, and play with the node edit form :-)
Technical side notes (intended mainly to Karen :-)
- the patch also simplifies the convoluted solution I committed a few days ago to get the AHAH-'add more values' button work inside fieldgroups. Much simpler solution, to the sacrifice of code independence between content.module and fieldgroup.module (ideally, content.module should not make assumptions on what fieldgroup.module does - but it's currently not the case anyway, and I doubt it can be attained, so...)
- proposal : content_multiple_value_form takes care of providing the widget's #title (just like it does for #required), so that the field label does not get repeated for every widget. For now, only text_widget accounts for that.
- the new implementation of the AHAH-'add more' handler does not use the $get_delta param of content_field_form() anymore : we rebuild the form element including all the items. So if we go that route, the code in content_field_form() could probably be simplified a little (not done here)
- OK, I started my getting back to cck/drupal work with a 'fun feature' :-) But I'll stick my head in content_alter_db() really soon :-)
| Comment | File | Size | Author |
|---|---|---|---|
| cck_order_items.patch | 17.17 KB | yched |
Comments
Comment #1
karens commentedVery cool!! I don't what the chances are of getting the core fix in are, though :(
Comment #2
karens commentedThe core fix just got committed, which means we should be OK to add this in now. I'll take it for a spin :)
Comment #3
karens commentedLove it!! This is going to be a really cool new feature for CCK D6.
I extended the changes for #title to all the other modules and committed it.
Comment #4
karens commentedForgot to change status.
Comment #5
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.