Make WordPress Core

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#10251 closed defect (bug) (fixed)

WP_Widget_Recent_Posts in default-widgets.php Doesn't Work With Persistent Caching

Reported by: brianwhite's profile brianwhite Owned by: azaozz's profile azaozz
Milestone: 2.8.1 Priority: normal
Severity: normal Version: 2.8
Component: Widgets Keywords: tested
Focuses: Cc:


WP_Widget_Recent_Posts in default-widgets.php doesn't work with persistent caching enabled. This is because the function RETURNS the list of recent posts retrieved from the cache rather than prints the list of recent posts to the screen. The fix is trivial. Replace "return" on line 530 with "echo". (A simple patch is attached.)

Reproducibility instructions. Enabled persistent caching. (i.e. upload/enable a version of object-cache.php which supports your caching backend.) Observe that no output is created for the WP_Widget_Recent_Posts widget.

Attachments (2)

default-widgets.diff (383 bytes) - added by brianwhite 15 years ago.
Patch for\default-widgets.php
10251.patch (508 bytes) - added by azaozz 15 years ago.

Download all attachments as: .zip

Change History (7)

15 years ago

Patch for\default-widgets.php

#1 @Denis-de-Bernardy
15 years ago

  • Keywords blocker commit added
  • Milestone changed from Unassigned to 2.8.1

15 years ago

#2 @azaozz
15 years ago

  • Keywords needs-testing added; blocker commit WP_Widget_Recent_Posts wp_cache default-widgets removed

The original patch seems wrong, it should exit the function after echoing the widget content.

#3 @Denis-de-Bernardy
15 years ago

  • Keywords tested added; needs-testing removed

to test, call the widget twice artificially.

#4 @azaozz
15 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [11650]) Fix cache in WP_Widget_Recent_Posts, fixes #10251 for 2.8

#5 @azaozz
15 years ago

(In [11651]) Fix cache in WP_Widget_Recent_Posts, fixes #10251 for trunk

Note: See TracTickets for help on using tickets.