Skip to content
Snippets Groups Projects

Issue #2866619 by kksandr: added link access check to the node form

Open kksandr requested to merge issue/drupal-2866619:2866619-dont-use-link into 11.x
Files
2
@@ -281,7 +281,7 @@ public function save(array $form, FormStateInterface $form_state) {
$node->save();
$node_link = $node->toLink($this->t('View'))->toString();
$context = ['@type' => $node->getType(), '%title' => $node->label(), 'link' => $node_link];
$t_args = ['@type' => node_get_type_label($node), '%title' => $node->toLink()->toString()];
$t_args = ['@type' => node_get_type_label($node), '%title' => $node->access('view') ? $node->toLink()->toString() : $node->label()];
if ($insert) {
$this->logger('content')->info('@type: added %title.', $context);
Loading