new_content[this.showEffect] is not a function
[Break on this error] else if(this.showEffect!='show'){new_content[this.showEffect](this.showSpeed);

CommentFileSizeAuthor
#5 ajax_comment.patch764 bytesivrh
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rjbrown99’s picture

Status: Active » Closed (cannot reproduce)

Thank you for the notice, however significantly more information will be needed to provide any assistance with your issue. I suggest moving to the -dev version and reviewing the README file, especially the troubleshooting section, and then providing a more detailed description of your problem. Thanks.

dgastudio’s picture

Status: Closed (cannot reproduce) » Active

same bug on post or preview, new_content[this.showEffect] is not a function

but only happens with one content type.

dgastudio’s picture

sorry, it solved:
it was becouse i have in node.tpl

 if (function_exists('comment_render') && $node->comment) {
   print comment_render($node, $node->cid);
   $node->comment = NULL;
} 

after remove, everything is ok.

rjbrown99’s picture

Status: Active » Closed (works as designed)
ivrh’s picture

Status: Closed (works as designed) » Needs review
FileSize
764 bytes

This issue happen due to incorrect drupal_add_js() usage in ajax_comments.module.
In my case there was no ajax_comments.js file loaded at all (fix provided in attached patch file, which also fixed a typo for progress bar definition, where instead of 'type' => 'bar' it was 'type' => '1bar').

The problem I had were probably due to custom theme_preprocess functions in place I had in my template.php file, but this is legitimate case and the module should provide compatibility for such cases. Now I have no issues after applying the patch attached.

The other issue in my case was that Drupal.settings.clean_url variable was undefined, leading to JS error (I fixed it by adding this variable manually)

aliyayasir’s picture

yes #3 is write!
Great module
thanks

vishun’s picture

I was also using something similar in the node template to relocate the comments and the patch from #5 helped allow me to keep the comments relocated. Though the patch does not appear to be a common Drupal suggested format, so that patch adds the following to ajax_comments.module:

<?php
 /**
 * Implementation of hook_init()
 */
function ajax_comments_init() {
  $path = drupal_get_path('module', 'ajax_comments');
  drupal_add_js($path .'/ajax_comments.js', 'module');
}
?>

To address the javascript error after the patch is applied due to Drupal.settings.clean_url being undefined I just added the javascript right from the comment relocation.

For example:

<?php
  if (function_exists('comment_render') && $node->comment) {
    print comment_render($node, $node->cid);
    $node->comment = NULL;
    drupal_add_js("Drupal.settings.clean_url=1", "inline");
  }
?>
qzmenko’s picture

Issue summary: View changes
Status: Needs review » Closed (outdated)

Issue is closed because 6.x version is unsupported. Feel free to open new issue for 7.x or 8.x versions of module.