diff --git a/composer.json b/composer.json index bb318334aa0b90192ff4af5b2a423d68e2b80544..da96d02d03f37f9d8748c8d7e5f8d735d0ac5e9a 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 3f2f7d3e48ecb8e00f3a82d5841cee8467d65573..886ba4f5a83effd020aa39b6b24d7956f99280bf 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 5f5b4b2d153a6955a4185beff8729144fb4fb9d0..2aa1ad6f727f7d8508966d73b223adc520389e99 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 b87dd9dd317276bed255aa28d9e909c8b4bda109..16436ad53c652e61a735394d71546d24ce063718 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 d2f58b16768d0632271a5385ee3b4d18d5612ed6..cf683fd92db19678ba716dd54be9074a4b0b441e 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 b07b867d1f991222944ea065e6b2a787b8d26ac9..811aab82530bfc46fd77d44936c2806a72187f8a 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 77aeea2cb67dbe7faec6841a53961359a3258a3f..8193e37bf83e4c46d783e67640de15e78f5c9032 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 f800f1dab05659e5192da61a62d11ac4850f9334..4cdb8dcc5b303829f10fbe3d418e0f8732ae3692 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); }