[buddypress-trac] [BuddyPress Trac] #7055: Emails: Attempting to use bp_send_mail() on non-root blogs fails

buddypress-trac noreply at wordpress.org
Fri May 6 19:01:53 UTC 2016


#7055: Emails: Attempting to use bp_send_mail() on non-root blogs fails
------------------------------------+--------------------
 Reporter:  r-a-y                   |       Owner:
     Type:  defect (bug)            |      Status:  new
 Priority:  normal                  |   Milestone:  2.6
Component:  API - Emails            |     Version:  2.5.0
 Severity:  normal                  |  Resolution:
 Keywords:  dev-feedback has-patch  |
------------------------------------+--------------------
Changes (by r-a-y):

 * keywords:  dev-feedback => dev-feedback has-patch


Old description:

> When a dev tries to use `bp_send_email()` on a non-root blog,
> `bp_send_email()` will fail.
>
> In `bp_send_email()`, we attempt to use `switch_to_blog()` to tell
> WordPress to use all BP root blog settings, however `switch_to_blog()`
> doesn't work that way, it only switches the WPDB DB prefixes.
>
> See #WP20541 for more details.
>
> To remedy this, we need to register the email type taxonomy ''even'' on
> non-root blogs.
>
> I'm currently working around this by registering the email type taxonomy
> only on the blog in question and on `$_POST` requests to limit the
> exposure of the email taxonomy type.
>
> Putting this in 2.6 since I don't think we can engineer a good solution
> before 2.5.3.

New description:

 When a dev tries to use `bp_send_email()` on a non-root blog,
 `bp_send_email()` will throw the `missing_email` WP error.

 In `bp_send_email()`, we attempt to use `switch_to_blog()` to tell
 WordPress to use all BP root blog settings, however `switch_to_blog()`
 doesn't work that way, it only switches the WPDB DB prefixes.

 See #WP20541 for more details.

 To remedy this, we need to register the email type taxonomy ''even'' on
 non-root blogs.

 I'm currently working around this by registering the email type taxonomy
 only on the blog in question and on `$_POST` requests to limit the
 exposure of the email taxonomy type.

 Putting this in 2.6 since I don't think we can engineer a good solution
 before 2.5.3.

--

Comment:

 Actually, since the taxonomy isn't public, we could just register the
 taxonomy at all times.

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


More information about the buddypress-trac mailing list