[wp-trac] [WordPress Trac] #34465: Uploader in Media Modal Not Working When Certain Library Arguments Present

WordPress Trac noreply at wordpress.org
Mon Dec 7 16:03:20 UTC 2015


#34465: Uploader in Media Modal Not Working When Certain Library Arguments Present
-------------------------------------------+------------------------------
 Reporter:  Funkatronic                    |       Owner:
     Type:  defect (bug)                   |      Status:  new
 Priority:  normal                         |   Milestone:  Awaiting Review
Component:  Media                          |     Version:  4.0
 Severity:  normal                         |  Resolution:
 Keywords:  has-screenshots needs-testing  |     Focuses:  ui
-------------------------------------------+------------------------------

Comment (by nikolov.tmw):

 I'd go on a limb here and say that it's done, so that in case you have
 multiple modal instances(say multiple uploaders on the same page), each
 one can have different query parameters.

 However the uploader queue is only one and so all modals would listen for
 when new attachments are uploaded globally and have to validate that the
 new attachment belongs to their collection of attachments(according to the
 query parameters).

 In the case of `author` in particular, it's really unlikely that you'd get
 a new upload that would not belong to that collection, however picture
 this situation(which '''is currently handled''', but imagine it was not):

 In one modal, you're allowing the user to create a featured gallery for
 the post. They can only select attachments that are uploaded to the
 current post. On the same page, you're also allowing the user to select a
 photo of the author that wrote the article(imagine guest blogging and you
 don't want to rely on the guest blogger's Gravatar).

 Since this author might write multiple articles on your blog, you let the
 user select from all attachments(so they don't have to upload a new one
 every time).

 Now, if I uploaded a new image to the modal that shows me all attachments
 and we didn't have the `uploadedTo` validation function(line 918), this
 new attachment could incorrectly show under the modal that only shows me
 the current post's attachments(if the global modal is configured to only
 upload globally - is that possible?).

 Might not be the best example, but I think it should illustrate what
 problem they are solving with that code - validating new attachments to
 make sure that they fit the restrictions put on each collection.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/34465#comment:15>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list