Closed (fixed)
Project:
Drupal core
Version:
x.y.z
Component:
node.module
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 Dec 2005 at 17:30 UTC
Updated:
19 Jan 2006 at 14:40 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Wesley Tanaka commentedby the way, i think the idea here: http://drupal.org/node/40256
would cause these kinds of problems to be flushed out very quickly.
Comment #2
Wesley Tanaka commentedplease commit me!
Also, for those searching for bugs using the search:
comment off default disabled disable new node forum topic comments ignore admin setting
Comment #3
Anonymous (not verified) commentedThis fixes the forum bug for 4.7 too. I think drupal sets comments disabled by default, so this would be better.
Comment #4
morbus iffI'm confused on this one - check comment_nodeapi, 'validate'. The $node->comment is being set there, to the default READ_WRITE (which I think is the right setting, not DISABLED) - why isn't it becoming a part of the $node? Isn't validate supposed to be called before save?
Comment #5
chx commentedin validate you can't change anything. validate validates.
Comment #6
morbus iffComment #7
morbus iffThis is the same patch as wtanaka's, but removes the useless set in comment_nodeapi, validate.
Comment #8
aaron commented+1 to Morbus's patch. And definitely keep it READ_WRITE. (This also fixes http://drupal.org/node/41152 )
Comment #9
aaron commentedSorry, forgot to set the status -- this does the job (Morbus's patch)
Comment #10
Anonymous (not verified) commentedMorbus's one looks correct...
Comment #11
dries commentedUgly patch. Why do we set that field in node_save()? We don't do that for any of the other 'default values'?
Comment #12
morbus iffYou're right. Attached a new one.
Comment #13
Wesley Tanaka commentedI've applied http://drupal.org/files/issues/_40563_comments_0.patch
against 4.7.0-test2, and it works for me.
Comment #14
morbus iffComment #15
morbus iffComment #16
Cvbge commentedTested, works as expected.
Comment #17
Steven commentedWhy are we providing a form value for a comment option in node.module? This does not make sense.
Comment #18
morbus iffPreviously, we were doing this in comment_nodeapi 'validate' - that code still remains, actually, and is removed as part of the original patch. Chx tells me that validate no longer (or maybe, never did - I dunno) modifies the form variables, so it can't happen there. The only other place it *could* happen would be in comment_nodeapi 'insert' and 'update', right? In which case, that'd be an entirely new query, just to set the node.comment? Need direction for proper handling of this.
Comment #19
merlinofchaos commentedThis is all, IMO, on the wrong track.
For one, we shouldn't be reverting to the default in any case. If an admin set it, just because a user edits it doesn't mean it should revert. And it doesn't have to.
formsapi gives us:
Comment #20
chx commentedMerlin, you are on the right track. Let's see this version.
Comment #21
chx commentedI moved the prepare op so that patch is smaller. To my eyes, this seems correct. The prepare bit happens when the node is new, otherwise node_load loads $node->comment. The form part is correct: admins can change this, users are not presented with this change but in place there is a value typed field (which is immutable) with same value.
Comment #22
UncleD commentedI thoroughly tested this patch, creating different users (non admin) before and after applying the patch. Before applying it, SELECT comment from node where nid=NODE# returned 0, and on the site, no comments being added was possible. After applying, nid=NODE# returned 2, and commenting was possible.
Comment #23
UncleD commentedTested http://drupal.org/files/issues/node-comment_1.patch just posted by chx. Works perfect. +1
Comment #24
Wesley Tanaka commentedWhat happens if an unprivileged user POSTS data on their own?
Comment #25
chx commentedNothing. When the form is built, the node->comment gets a value and that won't be overwritten in form builder.
Comment #26
dries commentedCommitted to HEAD. Thanks.
Comment #27
(not verified) commented