I was trying to fix this issue #1541800: History doesn't get updated after comment has been saved by using a rule on "comment save"
if ([current-user:uid]) {
db_merge('history')
->key(array(
'uid' => [current-user:uid],
'nid' => [comment:node:nid],
))
->fields(array('timestamp' => [site:current-date]))
->execute();
}
This rule executes fine when I have the ajax comments module turned off.
When I turn it off I this error in a popup when I try to submit a comment:
An AJAX HTTP error occurred.
HTTP Result Code: 500
Debugging information follows.
Path: /mt/system/ajax
StatusText: Internal Server Error
ResponseText: [{"command":"settings","settings":{"basePath":"\/mt\/","pathPrefix":"","ajaxPageState":{"theme":"bartik","theme_token":"J_NTC7ULEM ....
The comment does get saved. Any idea how to fix that?
Comments
Comment #1
BerdirInternal Server error is usually a PHP Fatal Error.
Try to turn on error logging in PHP if it isn't already and then check your server error logs for the actual error.
Comment #2
mototribe CreditAttribution: mototribe commentedThanks Berdir, great idea!
I'm getting:
When I replace the tokens with dummy values it works fine.
Maybe I'm better off using a hook_comment_insert?
cheers
UWE
Comment #3
mototribe CreditAttribution: mototribe commentedThis hook seems to work fine for me now:
Comment #4
formatC'vt CreditAttribution: formatC'vt commentedtry latest dev, please
Comment #5
formatC'vt CreditAttribution: formatC'vt commented