[buddypress-trac] [BuddyPress] #5241: $post object doesn't seem to be an object
buddypress-trac
noreply at wordpress.org
Wed Nov 13 14:11:44 UTC 2013
#5241: $post object doesn't seem to be an object
--------------------------+----------------------
Reporter: henrywright | Owner:
Type: defect (bug) | Status: closed
Priority: normal | Milestone:
Component: Core | Version:
Severity: normal | Resolution: wontfix
Keywords: |
--------------------------+----------------------
Changes (by boonebgorges):
* keywords: reporter-feedback =>
* status: new => closed
* resolution: => wontfix
* milestone: Awaiting Review =>
Comment:
> : I've been doing some investigation and can see an is_singular() check
is being used around the code attempting to get the $post property.
is_page() seems to return true for the change-avatar and private message
pages (where there notices are displayed) but the $post variable seems to
be null here. Could this be the reason why toys are being thrown out of
the push buggy?
Thanks for the additional investigation. This is related to the fact that
you're using a bp-default descendant. In a nutshell: Because BP content is
not WP content, it's not found by WP's initial parse_request() -> query
chain. So there is a portion of the load process where WP thinks that
requests for BP content are 404s. BP manually unsets this 404 before
loading its template, and where/how this happens depends on whether you're
using theme compat. The pre-theme-compat switch happens here
http://buddypress.trac.wordpress.org/browser/tags/1.8.1/bp-core/bp-core-
catchuri.php#L378. We manually flip is_page and is_singular to true, as
well as turning off the 404. But we don't do anything to the `$post`
global.
In contrast, theme compat fakes the entire content of a "dummy" post. See
http://buddypress.trac.wordpress.org/browser/tags/1.8.1/bp-members/bp-
members-screens.php#L407. So if you switch to a theme that utilizes theme
compat, the notices should go away.
(FWIW, I switched to bp-default to test and I *still* didn't see the
notices. So this is mostly an educated guess.)
Given that the old method is being abandoned, and given that the notices
shouldn't actually cause any real problems (aside from some non-optimized
robots/meta tags in wordpress-seo), I'm going to close this as wontfix. My
apologies to the wordpress-seo devs for the inconvenience - this issue
will disappear as people stop using the old BP themes.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5241#comment:3>
BuddyPress <http://buddypress.org/>
BuddyPress
More information about the buddypress-trac
mailing list