Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
In function comment_save(), when creating a new comment there's a call to db_ignore_slave(), but there's nothing like that when just updating the comment.
Comment | File | Size | Author |
---|---|---|---|
#5 | ignore_slave_db_after_saving_comment-965628-5.patch | 1.1 KB | AnalogFile |
#1 | ignore_slave_db_after_saving_comment-965628-1.patch | 758 bytes | AnalogFile |
Comments
Comment #1
AnalogFile CreditAttribution: AnalogFile commentedAnd the patch.
There's no testing and no current way to test this at the moment. See http://drupal.org/node/808560#comment-3681926
Comment #2
moshe weitzman CreditAttribution: moshe weitzman commentedLooks good. Should say comment instead of node at '// saved node to be propagated to the slave.'.
Comment #3
AnalogFile CreditAttribution: AnalogFile commentedI took the call and the comment from the other leg of the 'if' which is also part of the comment (it's creating a new comment instead of saving an existing one).
I'm not that familiar with Drupal internals. Since that comment says 'node' I assumed that when creating/saving a comment we were really within a "wider" operation related to the node.
So there are three possibilities:
1) we are always within a wider operation, and both comments are correct (as well as the patch in #1)
2) we are within a wider node-level save operation when we create the comment, but not when saving it. In this case #2 is correct and the patch in #1 should be changed to say "comment" instead of node.
3) both creation and deletion of a comment is, generally, done independently from the node. In this case not only the comment introduced in patch #1 is to be changed, but also the comment in the other leg of the 'if'.
I do not know which is of those three. I may come back to this when I understand Drupal internals better. But if someone else knows already, go ahead and either mark this RTBC or post the correct patch.
Comment #4
moshe weitzman CreditAttribution: moshe weitzman commented3) is correct. nice analysis. hope someone can re-roll accordingly.
Comment #5
AnalogFile CreditAttribution: AnalogFile commentedeasy
Comment #6
moshe weitzman CreditAttribution: moshe weitzman commentedthx
Comment #7
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks.