This bug is causing 2 errors:
1) Remove buttons are misplaced outside their table rows.
2) Remove button is granted without "Remove comments" permission.
To sum it up, when no "Remove comments" permission is granted, the "Remove" button still shows up, but misplaced outside its table row.
As a temporary fix, replace this:
$parents = array_merge($element['#parents'], array($id));
$element[$id]['remove'] = array(
'#name' => implode('_', $parents) . '_remove',
'#type' => 'submit',
'#value' => t('Remove'),
'#validate' => array(),
'#submit' => array('commentfield_submit'),
'#delta' => $id,
'#limit_validation_errors' => array($element['#parents']),
'#ajax' => $ajax_settings,
);
with this:
if ($element['#display_operations']) {
$parents = array_merge($element['#parents'], array($id));
$element[$id]['remove'] = array(
'#name' => implode('_', $parents) . '_remove',
'#type' => 'submit',
'#value' => t('Remove'),
'#validate' => array(),
'#submit' => array('commentfield_submit'),
'#delta' => $id,
'#limit_validation_errors' => array($element['#parents']),
'#ajax' => $ajax_settings,
);
}
Comments
Comment #1
interdruper commented