New hooks for comment handling
Posted: Sat Jun 09, 2007 1:50 am
Hi, when trying to process comments in a plugin, I found that the existing hook frontend_saveComment is positioned before the actual database entry is made, making it lack information on the inserted comment's ID. Simply guessing that it is the latest comment's ID plus one could be wrong in case another comment comes in first. What I could not find at all are hooks for the approval or deletion of comments. Obviously, a hook is just a line that I could add myself, but it makes upgrades tedious... What about some hook inflation? 
Four other things on my mind:
- The text "A draft of this entry has been saved" is a little bit misleading as the entry is never duplicated. What about "This entry has been saved and flagged as a draft"?
- In functions_entries.inc.php, a distinction between backend_publish and backend_save is made, stating the difference as "Send publish tags if either a new article has been inserted from scratch, or if the entry was previously stored as draft and is now published". What follows, however, is , put shortly (!isDraft and (isNew or isDraft)). Considering that the "or isDraft" is logically superfluous, the distinction effectively comes down to "new and published" vs. "old or draft". The respective hooks don't necessarily make sense. There are really four cases, each of which could get its hook. Currently, many plugins seem to handle this by considering both hooks at the same time and making distinctions by themselves.
- What's the "author" column in "entries" for? There's already an "authorid"...
- It is normal that when having submitted a comment, the form to enter another is not displayed on the immediately resulting page and thus the "Reply" links are ineffective? Or have I broken something?
Four other things on my mind:
- The text "A draft of this entry has been saved" is a little bit misleading as the entry is never duplicated. What about "This entry has been saved and flagged as a draft"?
- In functions_entries.inc.php, a distinction between backend_publish and backend_save is made, stating the difference as "Send publish tags if either a new article has been inserted from scratch, or if the entry was previously stored as draft and is now published". What follows, however, is , put shortly (!isDraft and (isNew or isDraft)). Considering that the "or isDraft" is logically superfluous, the distinction effectively comes down to "new and published" vs. "old or draft". The respective hooks don't necessarily make sense. There are really four cases, each of which could get its hook. Currently, many plugins seem to handle this by considering both hooks at the same time and making distinctions by themselves.
- What's the "author" column in "entries" for? There's already an "authorid"...
- It is normal that when having submitted a comment, the form to enter another is not displayed on the immediately resulting page and thus the "Reply" links are ineffective? Or have I broken something?