WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#14705 closed defect (bug) (invalid)

[15531] breaks is_*() conditional tags

Reported by: freddyware Owned by:
Milestone: Priority: normal
Severity: critical Version:
Component: Query Keywords:
Focuses: Cc:

Description

#14494 suggested moving the is_*() conditional tags into the WP_Query class and [15531] changed trunk/wp-includes/query.php to redirect those calls to the global $wp_query object.

However, it appears that this move has broken at least one of the conditional tags because $wp_query isn't known -- this is the error:

Fatal error: Call to a member function is_feed() on a non-object in /home/frederickd/frederickding.com/wordpress/wp-includes/query.php on line 270

See line 270.

Right now I am experiencing this critical error on the homepage of a site running trunk.

Attachments (1)

is_feed_broken-20100826.png (109.8 KB) - added by freddyware 4 years ago.
is_feed() creates a critical error that stops execution.

Download all attachments as: .zip

Change History (6)

freddyware4 years ago

is_feed() creates a critical error that stops execution.

comment:1 ryan4 years ago

Is the theme calling is_feed() before $wp_query is created?

comment:2 ryan4 years ago

  • Milestone changed from Awaiting Review to 3.1

comment:3 freddyware4 years ago

  • Keywords needs-patch removed

Aha. I did a debug_backtrace() and found that the violating line was in the W3 Total Cache plugin, which calls is_feed() on line 807 of w3-total-cache/lib/W3/Plugin/Minify.php.

While I recognize that this is now a bug in a plugin and not core, it seems problematic that this core commit breaks W3 Total Cache. I guess I now have to ... disable the caching plugin.

Is there any way that this move can be made more backward-compatible?

comment:4 scribu4 years ago

  • Milestone 3.1 deleted
  • Resolution set to invalid
  • Status changed from new to closed

This change only makes the error in W3 Total Cache more apparent. Previously, it would have triggered a notice, which normally isn't displayed.

So this is actually a good oportunity for the plugin author to fix the code.

comment:5 nacin4 years ago

Going to manage the side effects of [15531] in #14729.

Note: See TracTickets for help on using tickets.