Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pwaterz’s picture

Found a bug, new patch

pwaterz’s picture

Fixing another issue :)

pwaterz’s picture

Made some more changes.

phayes’s picture

Status: Active » Needs review

Marking as needs review. We've tested it and it works.

pwaterz’s picture

Cleaned up the patch a bit

Status: Needs review » Needs work

The last submitted patch, 0001-Adding-comment-reply-as-ctools-task 1.patch, failed testing.

phayes’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 0001-Adding-comment-reply-as-ctools-task 1.patch, failed testing.

drupalerocant’s picture

Any conclussion to this? Is the patch committed? Can we use it safely?

pfaocle’s picture

Thanks for this patch! I've amended comment_reply_form.inc a little to avoid some warnings (checking $comment object) and also refer to $context[0] for the ..._admin_title:

+function ctools_comment_reply_form_content_type_render($subtype, $conf, $panel_args, $context) {
+
+  $comment = ($context[1]->identifier == 'No context') ? NULL : clone($context[1]->data);
+  $block = new stdClass();
+  $block->module = 'comments';
+  if ($comment) $block->delta  = $comment->cid;
+  $block->title = t('Add comment');
+  $node = $context[0]->data;
+
+  module_load_include('inc', 'comment', 'comment.pages');
+  $block->content = comment_reply($node, ($comment ? $comment->cid : NULL));
+
+  return $block;
+}
+
+function ctools_comment_reply_form_content_type_admin_title($subtype, $conf, $context) {
+  return t('"@s" comment form', array('@s' => $context[0]->identifier));
+}
pfaocle’s picture

Status: Needs work » Needs review
pwaterz’s picture

The patch works. We have been using it for a while now.

iamcarrico’s picture

Status: Needs review » Reviewed & tested by the community

I can also confirm that this patch works as expected.

I have not gone line by line to ensure the code is right, just confirming functionality.

When the patch is applied--- ensure that there is a newline added to the end of the file. Drupal coding standards ftw.

merlinofchaos’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed. Thanks for the patch!

pwaterz’s picture

Woo!

osopolar’s picture

Status: Fixed » Needs review
FileSize
7.63 KB

'No context' is translateable. So it should be t('No context'):

$comment = ($context[1]->identifier == t('No context')) ? NULL : clone($context[1]->data);

I modified the patch.

pwaterz’s picture

neRok’s picture

Status: Needs review » Needs work

Not sure if I should start a new issue of post here, but I have just updated to the latest Ctools dev to test this out. When I Add Content > Comment > Comment Reply Form, the output is the same as the standard comment form, with the node or comment you are replying to above the form itself. There should be an option to disable the node/comment view, so I can output just the form.

For example, I may want the form itself on the right, and the node/comment view on the left. The current panel is just lumping everything together. The current panel may be better called "Rendered Comment Reply Page" or something of that effect, and a new form-only panel added.

pwaterz’s picture

What this does is allow you to convert the comment page to a panel. If you would like more layers of abstractions, I invite you to submit a patch with more ctools content types with it broken apart.

phayes’s picture

Status: Needs work » Fixed

@osopolar,

You should create a new issue for the above problem. This has already been merged and fixed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.