[wp-trac] [WordPress Trac] #19266: Media attached to (custom) pages 404 when loading the media attachment page

WordPress Trac wp-trac at lists.automattic.com
Thu Nov 17 14:21:15 UTC 2011


#19266: Media attached to (custom) pages 404 when loading the media attachment page
--------------------------+----------------------
 Reporter:  pbearne       |       Owner:
     Type:  defect (bug)  |      Status:  closed
 Priority:  high          |   Milestone:
Component:  General       |     Version:  3.2.1
 Severity:  critical      |  Resolution:  invalid
 Keywords:                |
--------------------------+----------------------
Changes (by duck_):

 * keywords:  reporter-feedback =>
 * status:  new => closed
 * version:  3.3 => 3.2.1
 * resolution:   => invalid
 * milestone:  3.3 =>


Comment:

 Replying to [comment:8 pbearne]:
 > So the Question now is what is it doing?

 This is being caused by [http://plugins.trac.wordpress.org/browser/custom-
 content-type-manager/trunk/includes/CCTM.php#L2258 CCTM::request_filter]
 being hooked into `request`. This changes the SQL query to include
 `post_type IN ('post')` for attachments which obviously breaks:

 {{{
 SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name =
 'YOUR_ATTACHMENT' AND wp_posts.post_type IN ('post') ORDER BY
 wp_posts.post_date DESC
 }}}

 In my testing this also occurs with this plugin and 3.2.1, so it's not a
 change in 3.3.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/19266#comment:10>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list