WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 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:

Description

if you select attachment URL in the media post

For a example see screenshot for the settings

http://wp-dev.bearne.ca/test/

click on the image and you get an 404

Attachments (1)

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

Download all attachments as: .zip

Change History (12)

pbearne2 years ago

Screenshot of settings

comment:1 nacin2 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.

comment:2 nacin2 years ago

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

comment:3 ocean902 years ago

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

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

comment:4 ocean902 years ago

  • Keywords reporter-feedback added

comment:5 follow-up: pbearne2 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%/

Paul

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

comment:6 in reply to: ↑ 5 duck_2 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.

comment:7 ocean902 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?

comment:8 follow-up: pbearne2 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?

comment:9 pbearne2 years ago

Hi

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

Paul

comment:10 in reply to: ↑ 8 duck_2 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.

comment:11 pbearne2 years ago

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

Note: See TracTickets for help on using tickets.