Make WordPress Core

Opened 7 years ago

Last modified 6 years ago

#41511 new defect (bug)

Attachment page URL not created correctly for image uploaded directly to library before being added to post

Reported by: kokkieh's profile kokkieh Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.8
Component: Editor Keywords:
Focuses: Cc:

Description

To replicate:

  1. Visit Media ->Add New and upload a media file
  2. Visit Posts ->Add New
  3. Click Add Media
  4. Select the media file previously uploaded and set Link To setting to Attachment Page
  5. Publish the post
  6. View post and click on image

What I expected:

To be taken to the attachment page for the image

What happened instead:

I got a Page not found error. Additionally the URL is formed as http://SITE_URL/FILE_SLUG/ which is not the correct format for media attachment pages.

I went back to the editor, clicked the image and clicked the edit icon. The Link To setting now shows that I have a Custom URL set instead of Attachment Page.

Updating the setting to attachment page again changes the URL to http://SITE_URL/YEAR/MONTH/POST_SLUG/FILE_SLUG/

If I now update the post, I can click the image to view the attachment page.

Context:

Reported via the WordPress.com support forums, but I've confirmed it on a non-WordPress.com site as well.

Change History (1)

#1 @mackensen
6 years ago

We're encountering this issue as well in 4.9.4.

Note: See TracTickets for help on using tickets.