[buddypress-trac] [BuddyPress Trac] #7265: uploads dir should filtered for cover images

buddypress-trac noreply at wordpress.org
Fri Feb 16 21:54:44 UTC 2018


#7265: uploads dir should filtered for cover images
-------------------------------------------------+------------------
 Reporter:  m_uysl                               |       Owner:
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  3.0
Component:  Core                                 |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch 2nd-opinion needs-testing  |
-------------------------------------------------+------------------

Comment (by imath):

 @boonebgorges

 I think there's no problem if we generate cover image upload paths outside
 of the `BP_Attachment_Cover_Image` class. But the cover image unlike the
 avatar is using a specific upload base_dir named `buddypress` :)

 So i think
 `BP_Tests_BP_Attachment_TestCases->test_bp_attachment_cover_image_user_upload()`
 should fail with 7265.diff. So i'd suggest :

 - 7265.02.patch which is passing the uploads data built within the Cover
 Image class into the argument of the new function
 `bp_attachments_cover_image_upload_dir`.
 - or 7265.02-alternative.patch which is basically using
 `bp_attachments_uploads_dir_get()` instead of `bp_upload_dir()` into the
 new function `bp_attachments_cover_image_upload_dir`.

 PS: I haven't tested both options, i've just successfully run the unit
 test suite on both of them.

 PS (2): I remember my idea was to organize the uploads_dir so that every
 BuddyPress attachments are in
 `wp-
 content/uploads/buddypress/object_type/object_id/attachment_type/file.ext`

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7265#comment:5>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list