WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#5256 closed defect (bug) (fixed)

Ambiguous column in query.php method get_posts()

Reported by: lawrence123 Owned by:
Milestone: 2.5 Priority: normal
Severity: normal Version: 2.3
Component: General Keywords: has-patch
Focuses: Cc:

Description

Using v2.3, line 871 should be:

$where = " AND $wpdb->posts.ID = " . $qp?;

and line 876 should be:

$where = " AND $wpdb->posts.ID = " . $qpage_id?;

Background: My plugin uses the posts_where and post_join filters. When you join with another table that also has an ID column the query will fail, because above lines currently show: ' AND ID = '

Attachments (1)

5256.diff (650 bytes) - added by DD32 6 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 DD326 years ago

  • Keywords has-patch added

what about line 849?
Attached a patch based on what you've asked for against trunk.

DD326 years ago

comment:2 foolswisdom6 years ago

  • Milestone changed from 2.5 to 2.4

comment:3 ryan6 years ago

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

(In [6310]) Disambiguate columns. Props lawrence123. fixes #5256

Note: See TracTickets for help on using tickets.