Skip to:
Content

bbPress.org

Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#1871 closed defect (bug) (fixed)

2.1-RC3: strange notice with twenty eleven theme

Reported by: michelwppi Owned by:
Milestone: 2.2 Priority: normal
Severity: normal Version: 2.0
Component: Appearance - Theme Compatibility Keywords:
Cc:

Description

Continuing to test bbp 2.1 and trying to understand the new templates and content hierarchy, it was a strange notice when displaying a topic.

PHP Notice:  Trying to get property of non-object in /Applications/MAMP/htdocs/wp_34_fr/wp-includes/post-template.php on line 30

$post object is concerned.

Step by step (and more than hour after), I discover that by default, bbp uses the page.php template file and in case of 2011 call content-page.php.

In 2011 at end of <article> : a line (22...) source of previous notice

</footer><!-- .entry-meta -->
</article><!-- #post-<?php the_ID(); ?> -->

It could mean that BBP don't restore the original post object and ID (giving the_title) after inserting is own loop displaying topic or forum in the_content() filter.

Voilà !

M.

Change History (3)

#1 @johnjamesjacoby
10 years ago

  • Component changed from Actions/Filters to Theme Compatability
  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 2.2

Some of this is unavoidable for now. Some themes will reference the $post global (or use functions that do) after bbPress has replaced some bits and pieces. I'm bumping this to 2.2, since it could no doubt be addressed better, but this has been an issue since 2.0.

#2 @johnjamesjacoby
9 years ago

  • Keywords needs-patch removed
  • Resolution set to fixed
  • Status changed from new to closed

I *think* we've handled this better in trunk, by not nooping the globals completely, and allowing the $post global to exist with some dummy information.

In cases where theme compat falls back to using page.php, the consequence here is ending up with "Edit" links that don't really belong inside the theme content areas. TwentyEleven is a culprit here, as are many other themes that are trying to mix convenience with theme/admin separation.

Closing as fixed.

Note: See TracTickets for help on using tickets.