[drupal-devel] [bug] Consistent return values of comment post(), and much more

chx drupal-devel at drupal.org
Fri Mar 18 11:36:37 UTC 2005


Issue status update for http://drupal.org/node/18656

 Project:      Drupal
 Version:      cvs
 Component:    comment.module
 Category:     bug reports
 Priority:     normal
 Assigned to:  moshe weitzman
 Reported by:  moshe weitzman
 Updated by:   chx
 Status:       patch

a big +1 for this in 4.6


chx



Previous comments:
------------------------------------------------------------------------

March 9, 2005 - 20:34 : moshe weitzman

Attachment: http://drupal.org/files/issues/comment_post.patch (15.33 KB)

This function which actually posts comments is comment_post(). This
function is currently pretty messy, and not suitable for use by other
modules. This patch assures that this function returns the comment ID
if the submission was successful, or else returns FALSE. This is
consistent with node_save(). In fact, I've renamed this function
comment_save() for consistency. The old comment_save() was merged with
comment_post(). I renamed comment_validate_form() to comment_validate()
for consistency with node as well.
To do this, I had to clean up quite more of the module. This patch
unifies the admin comment form and the usual comment form, similar to
what we did for nodes. This resulted lots of duplicate code removal.
I was able give Admins the ability to change the author and timestamp
of a comment. Thats been a feature request of mine since Jan 2003:
http://drupal.org/node/983
I removed comment links from the bottom of the comment preview box (as
we did for nodes)
I hope this is considered for commit early in the 4.7 cycle.


------------------------------------------------------------------------

March 10, 2005 - 00:14 : killes at www.drop.org

Much needed patch! I wouldn't mind seeing it in 4.6.


------------------------------------------------------------------------

March 10, 2005 - 21:41 : moshe weitzman

Attachment: http://drupal.org/files/issues/comment_post_0.patch (15.73 KB)

This version properly handles anonymous comments when using a setting
that allows for Name, Email, Homepage on a comment.
IMO, this patch refactors too much code to be considered for 4.6.


------------------------------------------------------------------------

March 12, 2005 - 17:29 : stefan nagtegaal

I tested this patch on current 4.6 RC I and this is, codewise and thus
usabilitywise a must have... Moshe you did a very good job in your
biggest patch of these two..
Dries, I think you should really have a close look at this patch! Its
very, very good and I couldn't find any errors in the code...





More information about the drupal-devel mailing list