[wp-trac] [WordPress Trac] #59866: Attachment pages are only disabled for users that are logged in

WordPress Trac noreply at wordpress.org
Thu Nov 9 16:39:56 UTC 2023


#59866: Attachment pages are only disabled for users that are logged in
-------------------------------------------------+-------------------------
 Reporter:  joppuyo                              |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  6.4.2
Component:  Media                                |     Version:  6.4
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-testing needs-unit-  |     Focuses:
  tests                                          |
-------------------------------------------------+-------------------------

Comment (by joppuyo):

 I can confirm that @chesio 's patch fixes the issue in my testing, here
 are the steps to reproduce:

 This is stock WordPress 6.4.1 with `wp_attachment_pages_enabled` set to
 `1`

 1. Upload image `foo.jpeg` to the media gallery
 2. Visit `https://example.com/foo` as a logged-in user
 3. Attachment page is displayed

 1. Upload image `foo.jpeg` to the media gallery
 2. Visit `https://example.com/foo` as an anonymous user
 3. Attachment page is displayed

 1. Create page called `Bar`
 2. Add image `foo.jpeg` to the post as an image block
 2. Visit `https://example.com/bar/foo` as a logged-in user
 3. Attachment page is displayed

 1. Create page called `Bar`
 2. Add image `foo.jpeg` to the post as an image block
 2. Visit `https://example.com/bar/foo` as an anonymous user
 3. Attachment page is displayed

 This is stock WordPress 6.4.1 with `wp_attachment_pages_enabled` set to
 `0`

 1. Upload image `foo.jpeg` to the media gallery
 2. Visit `https://example.com/foo` as a logged-in user
 3. You are redirected to the media file

 1. Upload image `foo.jpeg` to the media gallery
 2. Visit `https://example.com/foo` as an anonymous user
 3. Attachment page is displayed **<- This is incorrect behaviour**

 1. Create page called `Bar`
 2. Add image `foo.jpeg` to the post as an image block
 2. Visit `https://example.com/bar/foo` as a logged-in user
 3. You are redirected to the media file

 1. Create page called `Bar`
 2. Add image `foo.jpeg` to the post as an image block
 2. Visit `https://example.com/bar/foo` as an anonymous user
 3. Attachment page is displayed **<- This is incorrect behaviour**

 This is WordPress 6.4.1 with @chesio 's patch and
 `wp_attachment_pages_enabled` set to `1`

 1. Upload image `foo.jpeg` to the media gallery
 2. Visit `https://example.com/foo` as a logged-in user
 3. Attachment page is displayed

 1. Upload image `foo.jpeg` to the media gallery
 2. Visit `https://example.com/foo` as an anonymous user
 3. Attachment page is displayed

 1. Create page called `Bar`
 2. Add image `foo.jpeg` to the post as an image block
 2. Visit `https://example.com/bar/foo` as a logged-in user
 3. Attachment page is displayed

 1. Create page called `Bar`
 2. Add image `foo.jpeg` to the post as an image block
 2. Visit `https://example.com/bar/foo` as an anonymous user
 3. Attachment page is displayed

 This is WordPress 6.4.1 with @chesio 's patch and
 `wp_attachment_pages_enabled` set to `0`

 1. Upload image `foo.jpeg` to the media gallery
 2. Visit `https://example.com/foo` as a logged-in user
 3. You are redirected to the media file

 1. Upload image `foo.jpeg` to the media gallery
 2. Visit `https://example.com/foo` as an anonymous user
 3. You are redirected to the media file

 1. Create page called `Bar`
 2. Add image `foo.jpeg` to the post as an image block
 2. Visit `https://example.com/bar/foo` as a logged-in user
 3. You are redirected to the media file

 1. Create page called `Bar`
 2. Add image `foo.jpeg` to the post as an image block
 2. Visit `https://example.com/bar/foo` as an anonymous user
 3. You are redirected to the media file

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/59866#comment:13>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list