Making WordPress.org

Opened 8 years ago

Closed 8 years ago

#2583 closed defect (bug) (fixed)

Tagregator filters every request with function that can throw "undefined index" notices

Reported by: coreymckrill's profile coreymckrill Owned by: coreymckrill's profile coreymckrill
Milestone: Priority: normal
Component: WordCamp Site & Plugins Keywords:
Cc:

Description

Tagregator currently has four different "source" classes that it uses to aggregate hashtag data. Each of these classes adds a filter to the request hook so that the items in their Post Lists can be sorted by a particular post meta value. The filter checks for an orderby query var, and then compares the source's CPT to the post_type query var.

The problem is that some requests don't have a post_type query var, and if WP_DEBUG is turned on, this will throw an Undefined index: post_type notice, which can be especially problematic for Ajax and REST API requests. It also seems a bit overkill to filter every request when the sorting is only used on very specific admin screens.

Attachments (1)

2583.1.diff (4.2 KB) - added by coreymckrill 8 years ago.

Download all attachments as: .zip

Change History (3)

@coreymckrill
8 years ago

#1 @iandunn
8 years ago

  • Owner set to coreymckrill
  • Status changed from new to assigned

Looks good to me :)

#2 @coreymckrill
8 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.