Ensure module work althought not exists body field

This commit is contained in:
Manuel Cillero 2017-07-26 11:42:04 +02:00
parent 3c2bb788b4
commit 89bcb3d481

View file

@ -151,7 +151,7 @@ function _nodecomment_alter_nodecomment_form(&$form, $node, $target_node = NULL,
$form['comment_settings']['#access'] = FALSE; $form['comment_settings']['#access'] = FALSE;
// Remove the teaser splitter if body field is present. // Remove the teaser splitter if body field is present.
if (isset($form['body_field'])) { if (isset($form['body_field']) && is_array($form['body_field']['#after_build'])) {
$teaser_js_build = array_search('node_teaser_js', $form['body_field']['#after_build']); $teaser_js_build = array_search('node_teaser_js', $form['body_field']['#after_build']);
unset($form['body_field']['#after_build'][$teaser_js_build]); unset($form['body_field']['#after_build'][$teaser_js_build]);
$form['body_field']['teaser_js']['#access'] = FALSE; $form['body_field']['teaser_js']['#access'] = FALSE;