[buddypress-trac] [BuddyPress] #5084: Regression with 'bp_template_content' action
buddypress-trac
noreply at wordpress.org
Mon Jul 1 13:54:20 UTC 2013
#5084: Regression with 'bp_template_content' action
-------------------------------------------+-----------------------
Reporter: DJPaul | Owner:
Type: defect (bug) | Status: new
Priority: high | Milestone: 1.8
Component: Theme | Version: 1.8-beta
Severity: blocker | Resolution:
Keywords: reporter-feedback 2nd-opinion |
-------------------------------------------+-----------------------
Changes (by boonebgorges):
* keywords: => reporter-feedback 2nd-opinion
Comment:
Thanks for the report, DJPaul.
It's possible that there is a BP bug here, but it's not directly related
to 'bp_template_content' - a bit of debugging shows that that hook is only
being fired once (as is the wrapper function
`dpa_bp_members_my_achievements_content()`).
The duplication begins with `DPA_Shortcodes::display_user_achievements()`.
My backtrace shows that it's being called from two different spots. First,
it's called (as expected) from the
`dpa_bp_members_my_achievements_content()` function, hooked to
`bp_template_content` - ie, the normal BP template loading technique.
Second, it's being called from the Achievements theme compatibility layer,
in particular `dpa_replace_the_content()`.
Indeed, I'm not sure that this is a regression. The same duplication
appears to be happening when I test Achievements against BP's 1.7 branch.
It seems to me that the "right" way to do this (insofar as there is a
"right" way) is for Achievements to bail out of its theme compat layer if
BP's theme compat is running. One notable change in BP 1.8 is that there
is not really a reliable way to check for this, because BP unsets its
internal "is theme compat active?" flag very early in its own loop, making
it unavailable to nested content:
http://buddypress.trac.wordpress.org/browser/trunk/bp-core/bp-core-theme-
compatibility.php#L541.
As a data point, other plugins are *not* having the same duplication
problem. BuddyPress Docs, for instance, does not duplicate member template
content, hooked to 'bp_template_content' in members/single/plugins.php
DJPaul or jjj, I know this is an incomplete picture, but maybe it's enough
to spark an idea with one of you. Any thoughts? (a) Is this in fact a
regression? (b) If so, is it going to affect any plugins other than
Achievements, which is the only one (that I know of) that had such an
advanced theme compat layer? (c) If it's only Achievements, can we just
ask Paul to make the necessary mods, rather than playing around more with
BP's theme compat load order?
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5084#comment:2>
BuddyPress <http://buddypress.org/>
BuddyPress
More information about the buddypress-trac
mailing list