Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
comment.module
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
22 Feb 2010 at 02:24 UTC
Updated:
27 Apr 2010 at 23:20 UTC
Jump to comment: Most recent file
Comments
Comment #1
cha0s commentedHere's a start.
Comment #2
casey commentedSubscribing.
Comment #3
casey commentedReroll
Comment #4
bleen commentedWhy are we no longer redirecting to the page that contains this comment? If I just submitted a comment that appears on page 3 I'd expect to be redirected to page 3 so I can see my comment. Thoughts?
I may be completely wrong, but I thought watchdog messages were supposed to be outputted in a t() too (if so, there are several places in the patch to fix this ... if not, ignore this)
Powered by Dreditor.
Comment #5
bleen commentedstatus
Comment #6
berdir@#4
No, watchdog messages are translated when they are displayed.
Comment #7
bcn commentedRe-roll of #3 *trying* to take into account other recent changes to the comment module.
Regarding #4 "Why are we no longer redirecting to the page that contains this comment? "
AFAICT, we DO redirect to the page on which a comment appears, but in the case a comment doesn't save properly, then we redirect to the node that was attempting to be commented on...
Comment #9
jpmckinney commentedFix patch from #7. I'm not sure we need to replace the comment_save call in comment_approve(). Could loading and changing the status of a comment really cause comment_save to fail? There's one last call to comment_save in comment_admin_overview_submit(), and it also merely loads and changes the status of comments.
Comment #10
jpmckinney commentedComment #11
mradcliffe#9: Bear in mind I'm just looking at this patch and issue for the first time, but... if there is a db issue doing an update statement, then it would show up in comment_save no matter where it's called, right? Wouldn't it be better to remain consistent?
Comment #12
berdirI agree. Also don't forget that not only comment_save() itself can fail but any of the hook implementations that are called, a single broken query in any of these and the whole transation is rolled back.
Comment #13
jpmckinney commentedAdded handling of comment_save() to comment_admin_overview_submit().
Comment #14
mradcliffeThis looks pretty good to me. What does anyone else think about the translatable strings (I don't have an English degree)?
Looking at the sister topic, #704646: node_save() fails silently, in comment #28, Berdir suggests to use a sub class of Exception instead of Exception itself. This doesn't exist yet. Only an empty FieldException exists inside core modules. I think this is good to patch, and if it's necessary (critical or normal) for Drupal 7 to add in *Exceptions, then it should be done in another issue.
Comment #15
berdirJust pointing out the above statement isn't exactly true :)
Assuming that all Exceptions end with "Exception" and extend another Exception
Comment #16
mradcliffeI qualified my statement with "core modules" not just core for that reason. ;-)
Comment #17
catchIf we're going to have exceptions in core, then expecting every single caller to throw it's own errors with custom messages is completely unreasonable. Node module should re-throw the exception itself. In other words I agree with cha0s's post on http://drupal.org/node/704646#comment-2568634 and I'm not sure why that was ignored.
Comment #18
jpmckinney commentedHaving now read #704646: node_save() fails silently, I agree. Per #704646-33: node_save() fails silently, this patch re-throws the exceptions. I prefer having a big red error to littering code with exception handling (whose messages communicate no information other than "Failure, sorry.").
Comment #19
jpmckinney commentedComment #20
jpmckinney commentedChanging title to not presume handling exceptions is the right choice.
Comment #21
catchLooks much better.
Comment #22
catchForgot status change.
Comment #23
dries commentedCommitted to CVS HEAD. Thanks.