comment_form_node_form_alter两个变化:
1、$node的获取
drupal8
$node = $form_state['controller']->getEntity($form_state);
drupal7
$node = $form['#node'];
2、js的添加
drupal8
'#attached' => array(
'library' => array(array('comment', 'drupal.comment')),
),
drupal7
'#attached' => array(
'js' => array(drupal_get_path('module', 'comment') . '/comment-node-form.js'),
),
具体代码参考api
function comment_form_node_form_alter(&$form, $form_state) {
}