Make WordPress Core

Opened 2 years ago

Closed 10 days 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 2 years ago.

Download all attachments as: .zip

Change History (7)

@kovshenin2 years ago

comment:1 @kovshenin2 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.

comment:2 @helen2 years ago

Related: #24779

comment:3 @wonderboymusic11 days 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.

comment:4 @netweb11 days ago

  • Milestone changed from Awaiting Review to 4.4

comment:5 @DrewAPicture10 days 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.

comment:6 @DrewAPicture10 days 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.