core/modules/comment/comment.module | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index 867d4ae..097465d 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -1737,33 +1737,16 @@ function comment_library_info() { /** * #post_render_cache callback; inserts the comment form. * - * @param array $element - * A render array with the following keys: - * - #markup - * - #attached * @param array $context * An array with the following keys: * - entity_type: an entity type * - entity_id: an entity ID * - field_name: a comment field name - * @param string $token - * A token to uniquely identify this placeholder. * * @return array $element * The updated $element. */ -function comment_insert_form(array $element, array $context, $token) { - // Build comment form based on stored context. +function comment_insert_form(array $context) { $entity = entity_load($context['entity_type'], $context['entity_id']); - $comment_form = comment_add($entity, $context['field_name']); - - // Update the renderable. - if (!isset($element['#attached'])) { - $element['#attached'] = array(); - } - $element['#attached'] = drupal_merge_attachments($element['#attached'], drupal_render_collect_attached($comment_form, TRUE)); - $placeholder = drupal_render_cache_generate_placeholder(__FUNCTION__, $context, $token); - $element['#markup'] = str_replace($placeholder, drupal_render($comment_form), $element['#markup']); - - return $element; + return comment_add($entity, $context['field_name']); }