#7055 closed defect (bug) (fixed)
Emails: Attempting to use bp_send_mail() on non-root blogs fails
Reported by: | r-a-y | Owned by: | r-a-y |
---|---|---|---|
Milestone: | 2.5.3 | Priority: | normal |
Severity: | normal | Version: | 2.5.0 |
Component: | Emails | Keywords: | dev-feedback has-patch |
Cc: |
Description (last modified by )
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.
Attachments (1)
Change History (6)
#2
@
9 years ago
- Milestone changed from 2.6 to 2.5.3
Sounds good but please can you check bp_core->register_post_types
to see if we need to do the same for the post type? I imagine the same problem is there.
If we can get this fixed within ~24 hours hours, we'll 2.5.3, otherwise 2.5.4 (or 2.6).
#3
@
9 years ago
Sounds good but please can you check bp_core->register_post_types to see if we need to do the same for the post type? I imagine the same problem is there.
I've tested this and the email post type does not need to be registered network-wide because WP_Query::parse_query()
doesn't do an explicit post_type_exists()
check. Only the email taxonomy needs to be.
Going to commit.
Actually, since the taxonomy isn't public, we could just register the taxonomy at all times.