[buddypress-trac] [BuddyPress Trac] #7149: Templates: locating empty array of template(s) errors undefined variable

buddypress-trac noreply at wordpress.org
Sun Sep 18 19:28:11 UTC 2016


#7149: Templates: locating empty array of template(s) errors undefined variable
--------------------------+------------------
 Reporter:  Offereins     |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  2.7
Component:  Core          |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |
--------------------------+------------------
Changes (by Offereins):

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


Comment:

 @DJPaul Thanks for confirming the bug. In reply on your suggestion:
 returning a false-y string is okay with me. Most return value evaluations
 of the function are loosely compared, but I've found the following strict-
 type checks for output of `bp_locate_template()`:

 * `bp-core/bp-core-template-loader.php` @ line 175 in
 `bp_locate_template_asset()`
 * `bp-groups/classes/class-bp-group-extension.php` @ line 974 in
 `BP_Group_Extension::setup_edit_hooks()` (compares empty string)

 Furthermore, `bp_locate_template()` constructs the return value for:

 - `bp_get_template_part()` of which no value evaluations are found, but is
 widely used
 - `bp_displayed_user_get_front_template()` which has a strict type check
 in:
   - `bp-members/bp-members-template.php` @ line 1379 in
 `bp_displayed_user_front_template_part()`
 - `bp_groups_get_front_template()` which has a strict type check in:
   - `bp-groups/bp-groups-template.php` @ line 4189 in
 `bp_groups_front_template_part()`

 My conclusion is that this propagates to somewhat more functionality than
 you'd originally guess.

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


More information about the buddypress-trac mailing list