From 5c30729a8365dc7e7d649d597a11f170eecff26c Mon Sep 17 00:00:00 2001
From: nod_ <nod_@598310.no-reply.drupal.org>
Date: Fri, 23 Feb 2024 23:04:57 +0100
Subject: [PATCH] Issue #3422845 by scott_euser, smustgrave: Improve the
 relationships documentation in views.api.php

---
 core/modules/views/views.api.php | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/core/modules/views/views.api.php b/core/modules/views/views.api.php
index 503ef9064d5c..846c108c90f3 100644
--- a/core/modules/views/views.api.php
+++ b/core/modules/views/views.api.php
@@ -313,6 +313,8 @@ function hook_views_data() {
       'id' => 'standard',
       // Default label for relationship in the UI.
       'label' => t('Example node'),
+      // Description shown within the add relationship handler in the UI.
+      'help' => t('Relationship between the node and node field data'),
     ],
   ];
 
@@ -495,8 +497,8 @@ function hook_views_data_alter(array &$data) {
   // In Views data definitions, each field can have only one relationship. So
   // rather than adding this relationship directly to the $data['foo']['fid']
   // field entry, which could overwrite an existing relationship, we define
-  // a dummy field key to handle the relationship.
-  $data['foo']['unique_dummy_name'] = [
+  // a placeholder field key to handle the relationship.
+  $data['foo']['unique_placeholder_name'] = [
     'title' => t('Title seen while adding relationship'),
     'help' => t('More information about the relationship'),
 
@@ -506,11 +508,13 @@ function hook_views_data_alter(array &$data) {
       // Database field name in example_table for the join.
       'base field' => 'eid',
       // Real database field name in foo for the join, to override
-      // 'unique_dummy_name'.
+      // 'unique_placeholder_name'.
       'field' => 'fid',
       // ID of relationship handler plugin to use.
       'id' => 'standard',
       'label' => t('Default label for relationship'),
+      // Description shown within the add relationship handler in the UI.
+      'help' => t('Description of the placeholder field relationship'),
     ],
   ];
 
-- 
GitLab