Make WordPress Core

Opened 17 years ago

Closed 17 years ago

#5256 closed defect (bug) (fixed)

Ambiguous column in query.php method get_posts()

Reported by: lawrence123's profile 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 17 years ago.

Download all attachments as: .zip

Change History (4)

#1 @DD32
17 years ago

  • Keywords has-patch added

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

@DD32
17 years ago

#2 @foolswisdom
17 years ago

  • Milestone changed from 2.5 to 2.4

#3 @ryan
17 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.