Skip to:
Content

BuddyPress.org

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#6914 closed enhancement (fixed)

bp_locate_template() in WordPress Administration

Reported by: imath's profile imath Owned by: djpaul's profile DJPaul
Milestone: 2.6 Priority: normal
Severity: normal Version:
Component: Core Keywords: dev-feedback
Cc:

Description

#6912 and previously the Avatar UI showed we need to be able to load template parts within the WordPress Administration.

For 2.6 @DJPaul suggested we try to figure out why we are using the WP_USE_THEMES or DOING_AJAX restrictions.

Change History (10)

#1 @DJPaul
9 years ago

I think we might need to bring this forward despite r10594.

@modemlooper had some code that sends an email for new comments https://gist.github.com/modemlooper/8aeb3b03e2a58f1a129e and this fails in exactly the same place. Dealing with new comments is so trivial I am embarrassed if our solution is "filter something on and off".

I looked back through this line's history: r7842 and r7837. I guess we need to next remove these checks and run unit tests and debug what's happening.

#2 @DJPaul
9 years ago

imath tested removing the checks and running unit tests, apparently everything worked correctly. So, for 2.5, we have two options:

1) Leave as-is and tell people to use new filter in r10594
2) Or remove the WP_USE_THEMES + DOING_AJAX checks.

This ticket was mentioned in Slack in #buddypress by djpaul. View the logs.


9 years ago

#4 @boonebgorges
9 years ago

I'd say tear out the checks.

#5 @DJPaul
9 years ago

er, can I sneak this into 2.5 ?

#6 @DJPaul
9 years ago

As tempting and maybe convenient that might be for developers using bp_send_email in custom situations, I think my last suggestion was over-eager.

#7 @DJPaul
9 years ago

  • Owner set to DJPaul
  • Status changed from new to assigned

I'm going to remove the checks. YOLO (aka BuddyPress 2.6.1-paul-messed-up).

#8 @djpaul
9 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 10746:

Core: modify bp_locate_template() to support loading templates in code executed inside the wp-admin scope.

The recent Emails and Avatars changes showed a weakness in the function where we were unable to load BuddyPress templates inside wp-admin because the constants WP_USE_THEMES and DOING_AJAX are falsey. These checks were introduced in r7842 and r7837, seemingly to prevent errors during PHPUnit runs.

As our test environment has improved over the intervening years and because none of our tests are currently producing errors when these checks are removed, we can safely revert them and give ourselves a more flexible function.

Fixes #6914

Props DJPaul, imath

#9 @DJPaul
9 years ago

  • Component changed from API to Core

#10 @DJPaul
9 years ago

  • Type changed from task to enhancement
Note: See TracTickets for help on using tickets.