Update comment revision id

bitman - January 21, 2008 - 01:01
Project:Comment CCK
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:bitman
Status:needs review
Description

Comment CCK needs some work to play well with other modules that also implement hook_comment. When combined with the casetracker module, comment_cck creates new node revisions when comments are added, but does not notify other modules, such as casetracker, of the new revision number. As a result, casetracker tries to update the old revision instead of the latest revision.

I've attached a patch that updates the revision number so that other modules can use it and changes the module weight so that comment_cck_comment is always called first. This seems to work with the casetracker module, but I haven't tested with any others. There is a version of the patch for the stable 1.0 release and a version for 1.x-dev. You have to run update.php after applying the patch.

A related issue that doesn't affect compatibility with casetracker is that the node cached by node_load is not updated with the new vid. This could be fixed by a call to "node_load($comment['nid'], NULL, TRUE);" to flush the cache and reload the module, but for performance reasons it's best to do this only if necessary. For now, I don't see that it is necessary in this case.

AttachmentSize
comment_cck_node_revision-1.0.patch1.38 KB
comment_cck_node_revision-1.x.patch1.54 KB

#1

killes@www.drop.org - June 1, 2008 - 17:53
Status:needs review» needs work

I've applied the part of the patch which introduces a reference.

#2

opensanta - May 8, 2009 - 21:40
Title:Incompatibility with casetracker module» Integration with casetracker module
Version:5.x-1.0» 6.x-1.0-beta1
Status:needs work» postponed (maintainer needs more info)

Is this change to how revisions are handled necessary in the latest release?

#3

opensanta - May 8, 2009 - 21:45
Title:Integration with casetracker module» Update comment revision id
Version:6.x-1.0-beta1» 6.x-1.x-dev
Status:postponed (maintainer needs more info)» needs review

Everything else is already updated, but this 5.x code is yet to be determined for 6.x

+ // Update comment revision id
+ $comment['revision_id'] = $node->vid;

I'm going to make a separate issue for picking a good weight value for this module.

 
 

Drupal is a registered trademark of Dries Buytaert.