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 9748cdd..475a72a 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 @@ -53,14 +53,14 @@ public function render_link(EntityInterface $entity, \stdClass $values) { $uid = $entity->id(); $path = "user/$uid/contact"; - if (!_contact_personal_tab_access($entity)) { + if (!_contact_personal_tab_access($entity->getBCEntity())) { return; } $this->options['alter']['make_link'] = TRUE; $this->options['alter']['path'] = $path; - $title = t('Contact %user', array('%user' => $entity->name)); + $title = t('Contact %user', array('%user' => $entity->name->value)); $this->options['alter']['attributes'] = array('title' => $title); if (!empty($this->options['text'])) { diff --git a/core/modules/contact/lib/Drupal/contact/Tests/Views/ContactLinkTest.php b/core/modules/contact/lib/Drupal/contact/Tests/Views/ContactLinkTest.php index 53e489f..c2f6a21 100644 --- a/core/modules/contact/lib/Drupal/contact/Tests/Views/ContactLinkTest.php +++ b/core/modules/contact/lib/Drupal/contact/Tests/Views/ContactLinkTest.php @@ -46,6 +46,9 @@ public static function getInfo() { ); } + /** + * {@inheritdoc} + */ protected function setUp() { parent::setUp(); @@ -54,11 +57,10 @@ protected function setUp() { $this->userData = $this->container->get('user.data'); } - /** * Tests contact link. */ - protected function testContactLink() { + public function testContactLink() { $accounts = array(); $accounts['root'] = user_load(1); // Create an account with access to all contact pages. @@ -100,7 +102,7 @@ protected function testContactLink() { * @param array $names * Users which should have contact links. */ - protected function assertContactLinks(array $accounts, array $names) { + public function assertContactLinks(array $accounts, array $names) { $result = $this->xpath('//div[contains(@class, "views-field-contact")]//a'); $this->assertEqual(count($result), count($names)); foreach ($names as $name) { diff --git a/core/modules/contact/tests/modules/contact_test_views/contact_test_views.info.yml b/core/modules/contact/tests/modules/contact_test_views/contact_test_views.info.yml index a3f7c4e..eb3b5e3 100644 --- a/core/modules/contact/tests/modules/contact_test_views/contact_test_views.info.yml +++ b/core/modules/contact/tests/modules/contact_test_views/contact_test_views.info.yml @@ -1,9 +1,11 @@ name: 'Contact test views' +type: module description: 'Provides default views for views contact tests.' package: Testing version: VERSION -core: '8.x;' +core: 8.x dependencies: - contact - views + - user hidden: true