diff --git a/core/modules/contact/lib/Drupal/contact/Plugin/views/field/ContactLink.php b/core/modules/contact/lib/Drupal/contact/Plugin/views/field/ContactLink.php index dc9f055..19bef80 100644 --- a/core/modules/contact/lib/Drupal/contact/Plugin/views/field/ContactLink.php +++ b/core/modules/contact/lib/Drupal/contact/Plugin/views/field/ContactLink.php @@ -89,15 +89,12 @@ protected function renderLink(EntityInterface $entity, ResultRow $values) { // Check access when we pull up the user account so we know // if the user has made the contact page available. - $uid = $entity->id(); - - $path = "user/$uid/contact"; - if ($this->accessManager->checkNamedRoute('contact.personal_page', array('user' => $uid))) { + if (!$this->accessManager->checkNamedRoute('contact.personal_page', array('user' => $entity->id()))) { return; } $this->options['alter']['make_link'] = TRUE; - $this->options['alter']['path'] = $path; + $this->options['alter']['path'] = "user/{$entity->id()}/contact"; $title = t('Contact %user', array('%user' => $entity->name->value)); $this->options['alter']['attributes'] = array('title' => $title);