[wp-trac] [WordPress Trac] #28053: Fields with same name added to new media modal using 'attachment_fields_to_edit' do not pass as an array when saving.

WordPress Trac noreply at wordpress.org
Mon Apr 28 11:44:54 UTC 2014


#28053: Fields with same name added to new media modal using
'attachment_fields_to_edit' do not pass as an array when saving.
----------------------------------------+-----------------------------
 Reporter:  husobj                      |      Owner:
     Type:  defect (bug)                |     Status:  new
 Priority:  normal                      |  Milestone:  Awaiting Review
Component:  Media                       |    Version:  3.9
 Severity:  normal                      |   Keywords:
  Focuses:  javascript, administration  |
----------------------------------------+-----------------------------
 If you use the 'attachment_fields_to_edit' to add a set of checkboxes to
 the media modal attachment details (to implement a better UI for
 taxonomies for example) the save method of media.view.AttachmentCompat
 doesn't cater for fields with the same name to be passed as an array, it
 just passes the last field of that name that is found.

 When getting the fields to save, if multiple fields with the same name are
 found they should be passed as an array.

 I have attached a visual of the custom UI with checkboxes and a patch for
 testing.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/28053>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list