Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#19266 closed defect (bug) (invalid)

Media attached to (custom) pages 404 when loading the media attachment page

Reported by: pbearne Owned by:
Milestone: Priority: high
Severity: critical Version: 3.2.1
Component: General Keywords:
Focuses: Cc:


if you select attachment URL in the media post

For a example see screenshot for the settings


click on the image and you get an 404

Attachments (1)

editor.jpg (20.1 KB) - added by pbearne 7 years ago.
Screenshot of settings

Download all attachments as: .zip

Change History (12)

7 years ago

Screenshot of settings

#1 @nacin
7 years ago

This works in 3.2.1, I imagine?

Might be related to get_page_by_path() and rewrite changes. Haven't investigated yet.

#2 @nacin
7 years ago

  • Milestone changed from Awaiting Review to 3.3
  • Priority changed from normal to high
  • Severity changed from normal to critical

#3 @ocean90
7 years ago

pbearne, can you update to current trunk and test it again?

I tested it once and it fails, second one works.

#4 @ocean90
7 years ago

  • Keywords reporter-feedback added

#5 follow-up: @pbearne
7 years ago

just pulled down http://wordpress.org/nightly-builds/wordpress-latest.zip still seeing the problem

disabled all plugins etc.

Permalinks set to /%postname%/


Last edited 7 years ago by pbearne (previous) (diff)

#6 in reply to: ↑ 5 @duck_
7 years ago

Replying to pbearne:

just pulled down http://wordpress.org/nightly-builds/wordpress-latest.zip still seeing the problem

I just retested on the link you provided and it seems to be working.

#7 @ocean90
7 years ago

still seeing the problem

Can you give some steps to reproduce it? Filename? Is it possible to test it on another server/local installation?

#8 follow-up: @pbearne
7 years ago

Done bit more testing

And looks like this plugin is doing the breaking "Custom Content Type Manager" http://code.google.com/p/wordpress-custom-content-type-manager/

So the Question now is what is it doing?

#9 @pbearne
7 years ago


WordPress 3.3 beta3+ nightly build

create a post add an image and set the image link to the "Attachment Post URL"

save and view click the image to visit the image attachment page

turn on/off the "Custom Content Type Manager" plugin and the link breaks / works

see it fail here http://wp-dev.bearne.ca/2011/test/

Ping me if you need more info


#10 in reply to: ↑ 8 @duck_
7 years ago

  • Keywords reporter-feedback removed
  • Milestone 3.3 deleted
  • Resolution set to invalid
  • Status changed from new to closed
  • Version changed from 3.3 to 3.2.1

Replying to pbearne:

So the Question now is what is it doing?

This is being caused by 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.

#11 @pbearne
7 years ago

thanks for the feed back duck I have passed this back the dev

Note: See TracTickets for help on using tickets.