Ticket #8177 (new defect (bug))

Opened 2 months ago

Last modified 1 hour ago

Comments disabled in post but not in media gallery

Reported by: canon2k5 Assigned to:
Priority: normal Milestone: 2.8
Component: Gallery Version: 2.7
Severity: normal Keywords: has-patch needs-testing
Cc: janbrasna

Description

The options to "allow comments on this post" and "allow trackbacks and pingbacks on this post" have been deselected. The post will then return the expected message "Both comments and pings are currently closed". (ie. http://localhost/wordpress/?p=42) However, when selecting an image from an embedded native Gallery of that post, the image redirects to an attachment_id (ie. http://localhost/wordpress/?attachment_id=38)and still has a comments field. There is no decipherable means to disable comments on attachments through the native gallery.

If this is the expected behavior, I would believe that if a post may disable comments, then all of its content should be disabled.

Attachments

8177.diff (3.2 kB) - added by DD32 on 01/09/09 09:49:53.

Change History

11/12/08 17:17:07 changed by ryan

What theme are you using? This is probably a theme bug.

12/01/08 01:32:24 changed by janbrasna

  • cc set to janbrasna.
  • keywords set to image gallery attachment commenting discussion preference.

Confirming the bug in 2.7-beta3-9922 however not sure about possible solutions. Should commenting preferences be inherited from the attachment's parent post? Or set explicitly per attachment?

12/01/08 18:37:12 changed by janbrasna

  • keywords changed from image gallery attachment commenting discussion preference to image gallery attachment commenting discussion preference dev-feedback 2nd-opinion.
  • milestone changed from 2.8 to 2.7.

12/04/08 21:50:05 changed by westi

  • keywords changed from image gallery attachment commenting discussion preference dev-feedback 2nd-opinion to image gallery attachment commenting discussion preference reporter-feedback.

Please let us know what theme you are using.

12/04/08 22:38:32 changed by DD32

I dont think its a theme bug, Well, If it is, Its because the bug exists in the default theme.

<?php if ('open' == $post->comment_status) : ?>

The theme only checks that the current post's(attachment) comment status is open, And closing the status on a parent doesnt follow through to children.

A potential solution would be to do a lookup on the parent and check its comment_status, and set the attachment to the same during the query.

12/08/08 20:43:55 changed by ryan

  • milestone changed from 2.7 to 2.8.

We should add parent checking to pings_open() and comments_open() and encourage themes to use those. There is no time to do this for 2.7, however. Postponing to 2.8.

12/11/08 10:00:41 changed by janbrasna

The problem probably starts at the point when the attachment's data is pulled from DB to $post since both comment_status and ping_status are set to open in DB.

The question is, wouldn't it be better to explicitly set the pings&comments for individual attachments directly?

12/29/08 04:13:39 changed by DD32

  • keywords changed from image gallery attachment commenting discussion preference reporter-feedback to image gallery attachment commenting discussion preference reporter-feedback needs-patch.

01/09/09 09:49:53 changed by DD32

  • attachment 8177.diff added.

01/09/09 09:55:57 changed by DD32

  • keywords changed from image gallery attachment commenting discussion preference reporter-feedback needs-patch to has-patch needs-testing.

attachment 8177.diff added.

  • Sets comment/ping status to the parent posts status for attachments
  • Supports themes which use if ('open' == $post->comment_status) instead of comments_open()
  • Note, The changes to _close_comments_for_old_posts are so the closed-comments-on-the-fly work for the front page commenting links.. Included in this patch simply for review sake, The functionality for this ticket works without it.