Permalink
Browse files

fix(river): ensure unique comment form id

rel="toggle" fails to work with multiple river entries rendering
a comment form with the same id (due to multiple entries with the
same object entity). This adds river item id to the id attribute.
  • Loading branch information...
hypeJunction committed Sep 19, 2016
1 parent 65d63d8 commit 80e508ae1dc85db9aebb2b32dab904f1ea2b2674
Showing with 2 additions and 2 deletions.
  1. +1 −1 engine/lib/navigation.php
  2. +1 −1 views/default/river/elements/responses.php
@@ -430,7 +430,7 @@ function _elgg_river_menu_setup($hook, $type, $return, $params) {
if ($object->canComment()) {
$options = array(
'name' => 'comment',
'href' => "#comments-add-$object->guid",
'href' => "#comments-add-{$object->guid}-{$item->id}",
'text' => elgg_view_icon('speech-bubble'),
'title' => elgg_echo('comment:this'),
'rel' => 'toggle',
@@ -54,6 +54,6 @@
}
// inline comment form
$form_vars = array('id' => "comments-add-{$object->getGUID()}", 'class' => 'hidden');
$form_vars = array('id' => "comments-add-{$object->guid}-{$item->id}", 'class' => 'hidden');
$body_vars = array('entity' => $object, 'inline' => true);
echo elgg_view_form('comment/save', $form_vars, $body_vars);

0 comments on commit 80e508a

Please sign in to comment.