Issue #2825516 by mikelutz, amwhalen, jhedstrom, pwolanin, ragnarkurm: hook_node_access() is called with $op = 'delete' when the create node form is shown

merge-requests/55/head
Lee Rowlands 2019-08-06 16:39:06 +10:00
parent dbb87e1b9e
commit 771adc4826
No known key found for this signature in database
GPG Key ID: 2B829A3DF9204DC4
1 changed files with 3 additions and 2 deletions

View File

@ -251,8 +251,9 @@ class NodeForm extends ContentEntityForm {
'#submit' => ['::submitForm', '::preview'],
];
$element['delete']['#access'] = $node->access('delete');
$element['delete']['#weight'] = 100;
if (array_key_exists('delete', $element)) {
$element['delete']['#weight'] = 100;
}
return $element;
}