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 18a9560..9748cdd 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 @@ -8,33 +8,30 @@ namespace Drupal\contact\Plugin\views\field; use Drupal\Core\Entity\EntityInterface; +use Drupal\Component\Annotation\PluginID; use Drupal\user\Plugin\views\field\Link; -use Drupal\Component\Annotation\Plugin; /** * Defines a field that links to the user contact page, if access is permitted. * * @ingroup views_field_handlers * - * @Plugin( - * id = "contact_link", - * module = "contact" - * ) + * @PluginID("contact_link") */ class ContactLink extends Link { /** - * Overrides \Drupal\user\Plugin\views\field\Link::init(). + * {@inheritdoc} */ public function buildOptionsForm(&$form, &$form_state) { + parent::buildOptionsForm($form, $form_state); $form['text']['#title'] = t('Link label'); $form['text']['#required'] = TRUE; $form['text']['#default_value'] = empty($this->options['text']) ? t('contact') : $this->options['text']; - parent::buildOptionsForm($form, $form_state); } /** - * Overrides \Drupal\user\Plugin\views\field\Link::access(). + * {@inheritdoc} */ public function access() { // The access logic is implemented per row. @@ -43,9 +40,7 @@ public function access() { /** - * Overrides \Drupal\user\Plugin\views\field\Link::render_link(). - * - * @see _contact_personal_tab_access + * {@inheritdoc} */ public function render_link(EntityInterface $entity, \stdClass $values) { 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 d72f539..53e489f 100644 --- a/core/modules/contact/lib/Drupal/contact/Tests/Views/ContactLinkTest.php +++ b/core/modules/contact/lib/Drupal/contact/Tests/Views/ContactLinkTest.php @@ -29,7 +29,7 @@ class ContactLinkTest extends ViewTestBase { * * @var array */ - public static $modules = array('contact', 'contact_test_views'); + public static $modules = array('contact_test_views'); /** * Views used by this test. diff --git a/core/modules/contact/tests/modules/contact_test_views/test_views/views.view.test_contact_link.yml b/core/modules/contact/tests/modules/contact_test_views/test_views/views.view.test_contact_link.yml index 05ba081..341e925 100644 --- a/core/modules/contact/tests/modules/contact_test_views/test_views/views.view.test_contact_link.yml +++ b/core/modules/contact/tests/modules/contact_test_views/test_views/views.view.test_contact_link.yml @@ -8,19 +8,55 @@ display: display_plugin: default id: default display_title: Master - position: '' + position: '1' display_options: access: type: perm + options: + perm: 'access content' perm: 'access user profiles' cache: type: none + options: { } query: type: views_query + options: + disable_sql_rewrite: '0' + distinct: '0' + slave: '0' + query_comment: '' + query_tags: { } exposed_form: type: basic + options: + submit_button: Apply + reset_button: '0' + reset_button_label: Reset + exposed_sorts_label: 'Sort by' + expose_sort_order: '1' + sort_asc_label: Asc + sort_desc_label: Desc pager: type: full + options: + items_per_page: '10' + offset: '0' + id: '0' + total_pages: '' + expose: + items_per_page: '0' + items_per_page_label: 'Items per page' + items_per_page_options: '5, 10, 20, 40, 60' + items_per_page_options_all: '0' + items_per_page_options_all_label: '- All -' + offset: '0' + offset_label: Offset + tags: + previous: '‹ previous' + next: 'next ›' + first: '« first' + last: 'last »' + quantity: '9' style: type: default row: @@ -44,43 +80,10 @@ display: empty_zero: '0' link_to_user: '1' overwrite_anonymous: '0' - plugin_id: 'user_name' - contact: - id: contact - table: users - field: contact relationship: none group_type: group admin_label: '' - label: 'Link to contact page' exclude: '0' - alter: - alter_text: '0' - text: '' - make_link: '0' - path: '' - absolute: '0' - external: '0' - replace_spaces: '0' - path_case: none - trim_whitespace: '0' - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: '0' - max_length: '' - word_boundary: '1' - ellipsis: '1' - more_link: '0' - more_link_text: '' - more_link_path: '' - strip_tags: '0' - trim: '0' - preserve_tags: '' - html: '0' element_type: '' element_class: '' element_label_type: '' @@ -90,11 +93,15 @@ display: element_wrapper_class: '' element_default_classes: '1' empty: '' - hide_empty: '0' - empty_zero: '0' hide_alter_empty: '1' - text: '' - plugin_id: 'contact_link' + anonymous_text: '' + format_username: '1' + contact: + id: contact + table: users + field: contact + plugin_id: contact_link + exclude: '' filters: status: value: '1' @@ -104,16 +111,23 @@ display: expose: operator: '0' group: '1' - plugin_id: boolean + sorts: { } + title: test_contact_link + header: { } + footer: { } + empty: { } + relationships: { } + arguments: { } page_1: display_plugin: page id: page_1 display_title: Page - position: '' + position: '1' display_options: path: test-contact-link label: test_contact_link module: views -langcode: en id: test_contact_link tag: '' +uuid: 41459805-9045-477c-aa37-f7e6d60b4132 +langcode: en