Make WordPress Core

Opened 5 months ago

Last modified 4 months ago

#61554 new defect (bug)

Attachment page not redirecting to attachment file even after setting the option in wp-admin/options.php

Reported by: beingbaban's profile beingbaban Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 6.5.5
Component: Media Keywords: reporter-feedback needs-testing-info
Focuses: Cc:

Description

Found an issue. Kindly review if its a bug. So, if we upload attachments to wordpress media gallery and url is website.com/?attachment_id=101 or something. Even if we set attachment page to redirect to attachment file, it will not redirect. And with the same setting enabled, if we change permalink structure of attachment to something like website.com/photofile then when we open the attachment page, it will redirect to the png/jpg. Can someone please confirm if the are also facing same issue and if its a bug.

Change History (13)

#1 @poena
5 months ago

  • Keywords reporter-feedback added

Hi @beingbaban and welcome to WordPress Trac!

Can you please add detailed step by step instructions for how to reproduce the issue? That way, other contributors can test and see if they can reproduce it.

#2 @poena
5 months ago

  • Keywords needs-testing-info added

#3 @SergeyBiryukov
5 months ago

  • Component changed from General to Media

#4 @SergeyBiryukov
5 months ago

Hi there, thanks for the ticket!

Just noting that I could not reproduce the issue with the permalink structure set to Plain. Does it still happen with all plugins disabled and a default theme (Twenty Twenty-Four) activated?

#5 @beingbaban
5 months ago

Thank you for getting back.
Here are the steps.
On fresh wordpress site, Permalink structure set to plain under website.com/wp-admin/options-permalink.php.
Upload any image to any page.
Now, again goto website.com/wp-admin/options-permalink.php set structure to postname. Upload a photo.
We now have two photos, one with old permalink structure i.e. website.com/?attachment_id=101 and one with new website.com/photofile
Next, goto website.com/wp-admin/options.php and set wp_attachment_pages_enabled to 0.

Open website.com/?attachment_id=101, it will open as it is with comments box open.
and if we open the second attachment page i.e. website.com/photofile, it will redirect to website.com/photofile.png instead of opening attachment page.

This ticket was mentioned in Slack in #core-media by joedolson. View the logs.


5 months ago

#7 follow-up: @antpb
5 months ago

hi @beingbaban ! Thanks for the detailed reproduction steps. We are having trouble seeing the issue still, is there any chance that the install that you are seeing this on has caching configured in the environment? Is this a live site or on your local machine? It would be helpful to know your testing environment that you are seeing this so we can eliminate that possibility. If it is a live site on a server it is likely on that view of the page it is caching the render to some degree.

Leaving this ticket open to confirm if this is on a live environment or not. :)

#8 in reply to: ↑ 7 @beingbaban
5 months ago

Hi its on live website and there is no caching enabled. We suddenly started to receive spam comments and then we noticed this issue.

Replying to antpb:

hi @beingbaban ! Thanks for the detailed reproduction steps. We are having trouble seeing the issue still, is there any chance that the install that you are seeing this on has caching configured in the environment? Is this a live site or on your local machine? It would be helpful to know your testing environment that you are seeing this so we can eliminate that possibility. If it is a live site on a server it is likely on that view of the page it is caching the render to some degree.

Leaving this ticket open to confirm if this is on a live environment or not. :)

#9 @beingbaban
5 months ago

Hi Team, is there any way with which we can change permalink structure of all the media from old structure to plainname (new structure)?

This ticket was mentioned in Slack in #core-media by antpb. View the logs.


5 months ago

#11 follow-ups: @antpb
5 months ago

Thanks for confirming @beingbaban ! Can you provide more information about the environment this is hosted on? We are unable to reproduce this in our local environments and I suspect something server side might be getting in the way. As for changing the permalinks of your media, you should be able to change permalinks and see the changes after. That's why we were suspecting caching might be the source of the issue here.

If you can get us information about the server and where it is hosted, we will likely have a way to better reproduce it. Thank you!

#12 in reply to: ↑ 11 @beingbaban
5 months ago

Replying to antpb:

Thanks for confirming @beingbaban ! Can you provide more information about the environment this is hosted on? We are unable to reproduce this in our local environments and I suspect something server side might be getting in the way. As for changing the permalinks of your media, you should be able to change permalinks and see the changes after. That's why we were suspecting caching might be the source of the issue here.

If you can get us information about the server and where it is hosted, we will likely have a way to better reproduce it. Thank you!

its on cloud, also, the image is from 2019, while we changed permalink structure in 2020. But still 2019 are having old permalinks. Can you check that with FooGallery installed> create a gallery> then change permalink structure and if you are able to see the issue? Link for old remains old only.

#13 in reply to: ↑ 11 @beingbaban
4 months ago

Replying to antpb:

Thanks for confirming @beingbaban ! Can you provide more information about the environment this is hosted on? We are unable to reproduce this in our local environments and I suspect something server side might be getting in the way. As for changing the permalinks of your media, you should be able to change permalinks and see the changes after. That's why we were suspecting caching might be the source of the issue here.

If you can get us information about the server and where it is hosted, we will likely have a way to better reproduce it. Thank you!

Hi, were you able to check.

Note: See TracTickets for help on using tickets.