Make WordPress Core

Opened 4 years ago

Closed 21 months ago

#25556 closed defect (bug) (fixed)

Recent Comments widget does not flush cache when a post is trashed

Reported by: kovshenin Owned by: wonderboymusic
Milestone: 4.4 Priority: normal
Severity: normal Version: 2.8
Component: Widgets Keywords: has-patch
Focuses: Cc:


Steps to reproduce:

  1. Make sure persistent object caching is enabled
  2. Drop a recent comments widget to your sidebar
  3. Create a new post, comment on it
  4. Trash the post

Comment will still be visible in the widget, the link will lead to a 404.

Attachments (1)

25556.diff (587 bytes) - added by kovshenin 4 years ago.

Download all attachments as: .zip

Change History (7)

4 years ago

#1 @kovshenin
4 years ago

  • Keywords has-patch added

25556.diff flushes the widget cache during post status transitions. We could probably go further and check whether the post type supports and/or has comments.

#2 @helen
4 years ago

Related: #24779

#3 @wonderboymusic
21 months ago

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

In 34581:

Recent Comments Widget: a la [34464], this widget has the same mixed content issues. Remove the fragment caching. The comment queries are now split to scale. This was the only remaining widget with an HTML fragment cache.

Fixes #25556.

#4 @netweb
21 months ago

  • Milestone changed from Awaiting Review to 4.4

#5 @DrewAPicture
21 months ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

We actually need to deprecate the flush_widget_cache() method instead of just removing it.

#6 @DrewAPicture
21 months ago

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

In 34622:

Restore and deprecate the WP_Widget_Recent_Comments::flush_widget_cache() method, removed in [34580].

Fixes #25556.

Note: See TracTickets for help on using tickets.