From b21ff7035aaa7b0aa6917968adbbba1f89b48dcc Mon Sep 17 00:00:00 2001
From: Michael Lee <lee.5151@osu.edu>
Date: Tue, 13 Sep 2022 11:57:42 -0400
Subject: [PATCH] Installing drupal/realname (2.0.0-beta1)

---
 composer.json                                 |  1 +
 composer.lock                                 | 81 ++++++++++++++++++-
 vendor/composer/installed.json                | 81 +++++++++++++++++++
 vendor/composer/installed.php                 | 13 ++-
 web/modules/realname/realname.info.yml        |  7 +-
 web/modules/realname/realname.module          |  6 +-
 .../RealnameAutocompleteController.php        | 14 +++-
 .../migrate/process/RealnameReplaceToken.php  |  2 +-
 8 files changed, 192 insertions(+), 13 deletions(-)

diff --git a/composer.json b/composer.json
index bb318334aa..da96d02d03 100644
--- a/composer.json
+++ b/composer.json
@@ -148,6 +148,7 @@
         "drupal/paragraphs": "1.12",
         "drupal/pathauto": "1.8",
         "drupal/queue_mail": "^1.4",
+        "drupal/realname": "^2.0@beta",
         "drupal/rebuild_cache_access": "1.7",
         "drupal/recaptcha": "3.0",
         "drupal/recaptcha_v3": "^1.4",
diff --git a/composer.lock b/composer.lock
index 3f2f7d3e48..886ba4f5a8 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "9d9d279e2cf4d5a51bba9458507912b7",
+    "content-hash": "eb011c41b5cadbab2456f1bf3a4fdf16",
     "packages": [
         {
             "name": "alchemy/zippy",
@@ -6287,6 +6287,84 @@
                 "issues": "https://www.drupal.org/project/issues/queue_mail"
             }
         },
+        {
+            "name": "drupal/realname",
+            "version": "2.0.0-beta1",
+            "source": {
+                "type": "git",
+                "url": "https://git.drupalcode.org/project/realname.git",
+                "reference": "2.0.0-beta1"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://ftp.drupal.org/files/projects/realname-2.0.0-beta1.zip",
+                "reference": "2.0.0-beta1",
+                "shasum": "02d7e43792482f777601fa6ba317eabb90522cfd"
+            },
+            "require": {
+                "drupal/core": "^8 || ^9",
+                "drupal/token": "^1.0.0-alpha2"
+            },
+            "type": "drupal-module",
+            "extra": {
+                "drupal": {
+                    "version": "2.0.0-beta1",
+                    "datestamp": "1626668790",
+                    "security-coverage": {
+                        "status": "not-covered",
+                        "message": "Beta releases are not covered by Drupal security advisories."
+                    }
+                }
+            },
+            "notification-url": "https://packages.drupal.org/8/downloads",
+            "license": [
+                "GPL-2.0+"
+            ],
+            "authors": [
+                {
+                    "name": "hass",
+                    "homepage": "https://www.drupal.org/u/hass"
+                },
+                {
+                    "name": "See other contributors",
+                    "homepage": "https://www.drupal.org/node/266280/committers"
+                },
+                {
+                    "name": "coderintherye",
+                    "homepage": "https://www.drupal.org/user/297478"
+                },
+                {
+                    "name": "hass",
+                    "homepage": "https://www.drupal.org/user/85918"
+                },
+                {
+                    "name": "philltran",
+                    "homepage": "https://www.drupal.org/user/295397"
+                },
+                {
+                    "name": "rmiddle",
+                    "homepage": "https://www.drupal.org/user/192183"
+                },
+                {
+                    "name": "theamoeba",
+                    "homepage": "https://www.drupal.org/user/251700"
+                },
+                {
+                    "name": "tkuldeep17",
+                    "homepage": "https://www.drupal.org/user/2498278"
+                },
+                {
+                    "name": "voxpelli",
+                    "homepage": "https://www.drupal.org/user/341713"
+                }
+            ],
+            "description": "Provides token-based name displays for users.",
+            "homepage": "https://www.drupal.org/project/realname",
+            "support": {
+                "source": "https://git.drupal.org/project/realname.git",
+                "issues": "https://www.drupal.org/project/issues/realname"
+            }
+        },
         {
             "name": "drupal/rebuild_cache_access",
             "version": "1.7.0",
@@ -15703,6 +15781,7 @@
     "stability-flags": {
         "drupal/cache_control_override": 15,
         "drupal/multiple_fields_remove_button": 15,
+        "drupal/realname": 10,
         "drupal/ultimate_cron": 15
     },
     "prefer-stable": true,
diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json
index 5f5b4b2d15..2aa1ad6f72 100644
--- a/vendor/composer/installed.json
+++ b/vendor/composer/installed.json
@@ -6493,6 +6493,87 @@
             },
             "install-path": "../../web/modules/queue_mail"
         },
+        {
+            "name": "drupal/realname",
+            "version": "2.0.0-beta1",
+            "version_normalized": "2.0.0.0-beta1",
+            "source": {
+                "type": "git",
+                "url": "https://git.drupalcode.org/project/realname.git",
+                "reference": "2.0.0-beta1"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://ftp.drupal.org/files/projects/realname-2.0.0-beta1.zip",
+                "reference": "2.0.0-beta1",
+                "shasum": "02d7e43792482f777601fa6ba317eabb90522cfd"
+            },
+            "require": {
+                "drupal/core": "^8 || ^9",
+                "drupal/token": "^1.0.0-alpha2"
+            },
+            "type": "drupal-module",
+            "extra": {
+                "drupal": {
+                    "version": "2.0.0-beta1",
+                    "datestamp": "1626668790",
+                    "security-coverage": {
+                        "status": "not-covered",
+                        "message": "Beta releases are not covered by Drupal security advisories."
+                    }
+                }
+            },
+            "installation-source": "dist",
+            "notification-url": "https://packages.drupal.org/8/downloads",
+            "license": [
+                "GPL-2.0+"
+            ],
+            "authors": [
+                {
+                    "name": "hass",
+                    "homepage": "https://www.drupal.org/u/hass"
+                },
+                {
+                    "name": "See other contributors",
+                    "homepage": "https://www.drupal.org/node/266280/committers"
+                },
+                {
+                    "name": "coderintherye",
+                    "homepage": "https://www.drupal.org/user/297478"
+                },
+                {
+                    "name": "hass",
+                    "homepage": "https://www.drupal.org/user/85918"
+                },
+                {
+                    "name": "philltran",
+                    "homepage": "https://www.drupal.org/user/295397"
+                },
+                {
+                    "name": "rmiddle",
+                    "homepage": "https://www.drupal.org/user/192183"
+                },
+                {
+                    "name": "theamoeba",
+                    "homepage": "https://www.drupal.org/user/251700"
+                },
+                {
+                    "name": "tkuldeep17",
+                    "homepage": "https://www.drupal.org/user/2498278"
+                },
+                {
+                    "name": "voxpelli",
+                    "homepage": "https://www.drupal.org/user/341713"
+                }
+            ],
+            "description": "Provides token-based name displays for users.",
+            "homepage": "https://www.drupal.org/project/realname",
+            "support": {
+                "source": "https://git.drupal.org/project/realname.git",
+                "issues": "https://www.drupal.org/project/issues/realname"
+            },
+            "install-path": "../../web/modules/realname"
+        },
         {
             "name": "drupal/rebuild_cache_access",
             "version": "1.7.0",
diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php
index b87dd9dd31..16436ad53c 100644
--- a/vendor/composer/installed.php
+++ b/vendor/composer/installed.php
@@ -3,7 +3,7 @@
         'name' => 'osu-asc-webservices/d8-upstream',
         'pretty_version' => 'dev-master',
         'version' => 'dev-master',
-        'reference' => '6994b5f15885a0a4746c43abc1450b966b577d7d',
+        'reference' => '4c02c0277c4fd3757535858dc9c95d5c9198bb57',
         'type' => 'project',
         'install_path' => __DIR__ . '/../../',
         'aliases' => array(),
@@ -1081,6 +1081,15 @@
             'aliases' => array(),
             'dev_requirement' => false,
         ),
+        'drupal/realname' => array(
+            'pretty_version' => '2.0.0-beta1',
+            'version' => '2.0.0.0-beta1',
+            'reference' => '2.0.0-beta1',
+            'type' => 'drupal-module',
+            'install_path' => __DIR__ . '/../../web/modules/realname',
+            'aliases' => array(),
+            'dev_requirement' => false,
+        ),
         'drupal/rebuild_cache_access' => array(
             'pretty_version' => '1.7.0',
             'version' => '1.7.0.0',
@@ -1594,7 +1603,7 @@
         'osu-asc-webservices/d8-upstream' => array(
             'pretty_version' => 'dev-master',
             'version' => 'dev-master',
-            'reference' => '6994b5f15885a0a4746c43abc1450b966b577d7d',
+            'reference' => '4c02c0277c4fd3757535858dc9c95d5c9198bb57',
             'type' => 'project',
             'install_path' => __DIR__ . '/../../',
             'aliases' => array(),
diff --git a/web/modules/realname/realname.info.yml b/web/modules/realname/realname.info.yml
index d2f58b1676..cf683fd92d 100644
--- a/web/modules/realname/realname.info.yml
+++ b/web/modules/realname/realname.info.yml
@@ -2,12 +2,11 @@ name: 'Real Name'
 type: module
 description: 'Provides token-based name displays for users.'
 configure: realname.admin_settings_form
-core: 8.x
 core_version_requirement: ^8 || ^9
 dependencies:
   - token:token
 
-# Information added by Drupal.org packaging script on 2021-05-13
-version: '8.x-1.0-rc2+11-dev'
+# Information added by Drupal.org packaging script on 2021-07-19
+version: '2.0.0-beta1'
 project: 'realname'
-datestamp: 1620882450
+datestamp: 1626668793
diff --git a/web/modules/realname/realname.module b/web/modules/realname/realname.module
index b07b867d1f..811aab8253 100644
--- a/web/modules/realname/realname.module
+++ b/web/modules/realname/realname.module
@@ -214,7 +214,10 @@ function realname_update(User $account) {
     \Drupal::moduleHandler()->alter('realname_pattern', $pattern, $account);
 
     // Perform token replacement on the real name pattern.
-    $realname = \Drupal::token()->replace($pattern, ['user' => $account], ['clear' => TRUE, 'sanitize' => FALSE]);
+    $realname = \Drupal::token()->replace($pattern,
+        ['user' => $account],
+        ['clear' => TRUE, 'sanitize' => FALSE]
+    );
 
     // Remove any HTML tags.
     $realname = strip_tags(Html::decodeEntities($realname));
@@ -288,4 +291,3 @@ function realname_delete_all() {
 /**
  * @} End of "addtogroup realname".
  */
-
diff --git a/web/modules/realname/src/Controller/RealnameAutocompleteController.php b/web/modules/realname/src/Controller/RealnameAutocompleteController.php
index 77aeea2cb6..8193e37bf8 100644
--- a/web/modules/realname/src/Controller/RealnameAutocompleteController.php
+++ b/web/modules/realname/src/Controller/RealnameAutocompleteController.php
@@ -92,11 +92,19 @@ protected function getMatches(array $selection_settings, $string = '') {
       $uids = $query->execute()->fetchCol();
       $accounts = User::loadMultiple($uids);
 
-      /* @var $account User */
+      /** @var \Drupal\user\Entity\User $account */
       foreach ($accounts as $account) {
         $matches[] = [
-          'value' => $this->t('@realname (@id)', ['@realname' => $account->getDisplayName(), '@id' => $account->id()]),
-          'label' => $this->t('@realname (@username)', ['@realname' => $account->getDisplayName(), '@username' => $account->getAccountName()]),
+          'value' => $this->t('@realname (@id)',
+                  [
+                    '@realname' => $account->getDisplayName(),
+                    '@id' => $account->id(),
+                  ]),
+          'label' => $this->t('@realname (@username)',
+                   [
+                     '@realname' => $account->getDisplayName(),
+                     '@username' => $account->getAccountName(),
+                   ]),
         ];
       }
     }
diff --git a/web/modules/realname/src/Plugin/migrate/process/RealnameReplaceToken.php b/web/modules/realname/src/Plugin/migrate/process/RealnameReplaceToken.php
index f800f1dab0..4cdb8dcc5b 100644
--- a/web/modules/realname/src/Plugin/migrate/process/RealnameReplaceToken.php
+++ b/web/modules/realname/src/Plugin/migrate/process/RealnameReplaceToken.php
@@ -26,7 +26,7 @@ public function transform($value, MigrateExecutableInterface $migrate_executable
     //
     // At least two tokens may exists:
     // - [user:name-raw]
-    // - [current-user:name-raw]
+    // - [current-user:name-raw].
     return str_ireplace(':name-raw]', ':account-name]', $realname_pattern);
   }
 
-- 
GitLab