[buddypress-trac] [BuddyPress Trac] #6729: bp_attachments_uploads_dir_get throws notices on wp_upload_dir error

buddypress-trac noreply at wordpress.org
Thu Nov 12 07:48:21 UTC 2015

#6729: bp_attachments_uploads_dir_get throws notices on wp_upload_dir error
 Reporter:  sbrajesh                 |      Owner:
     Type:  defect (bug)             |     Status:  new
 Priority:  normal                   |  Milestone:  Awaiting Review
Component:  Component - Attachments  |    Version:
 Severity:  normal                   |   Keywords:
 Where there is an error generated by wp_upload_dir() this causes
 bp_upload_dir() to return empty/false which in turn is being used by

 This function does not check for empty value and assumes an array is
 returned, So it throws notice ":  Invalid argument supplied for foreach()
 in bp-core-attachments.php on line 46

 A check for empty will be nice to have. In my case the error was unable to
 create directory( which is very common case and BP should be able to
 notify it instead of throwing notice on all profile pages).

 PS: The Profile/Cover upload pages are notifying correct error on image
 upload, but the notice is thrown by all pages.

Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6729>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac

More information about the buddypress-trac mailing list