From ef693751b28d5d1283d14a8f7298f4242084a38e Mon Sep 17 00:00:00 2001 From: "lee.5151" <lee.5151@osu.edu> Date: Mon, 17 Jul 2023 13:41:18 -0400 Subject: [PATCH] Upgrading drupal/block_permissions (1.2.0 => 1.3.0) --- composer.json | 2 +- composer.lock | 18 ++-- vendor/composer/ClassLoader.php | 96 +++++++++---------- vendor/composer/InstalledVersions.php | 17 +++- vendor/composer/installed.json | 26 ++--- vendor/composer/installed.php | 10 +- .../{README.txt => README.md} | 36 ++++--- .../block_permissions.info.yml | 9 +- .../BlockPermissionsAccessControlHandler.php | 2 +- .../Functional/BlockFormRoutesAccessTest.php | 2 +- .../BlockPermissionsBrowserTestBase.php | 2 +- 11 files changed, 108 insertions(+), 112 deletions(-) rename web/modules/block_permissions/{README.txt => README.md} (68%) diff --git a/composer.json b/composer.json index b5779e3856..52bec52ef0 100644 --- a/composer.json +++ b/composer.json @@ -95,7 +95,7 @@ "drupal/anchor_link": "1.10", "drupal/better_exposed_filters": "^6.0", "drupal/block_field": "1.0.0-rc4", - "drupal/block_permissions": "1.2", + "drupal/block_permissions": "1.3", "drupal/block_region_permissions": "1.5", "drupal/bootstrap": "^3.23", "drupal/cache_control_override": "^1.0@alpha", diff --git a/composer.lock b/composer.lock index d2ce6f94d0..60561cda16 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": "12bd67cbe8783bcbbc1e4c2879d4a532", + "content-hash": "3b4e475b14fdd59ad902374006bc7df4", "packages": [ { "name": "alchemy/zippy", @@ -2118,26 +2118,26 @@ }, { "name": "drupal/block_permissions", - "version": "1.2.0", + "version": "1.3.0", "source": { "type": "git", "url": "https://git.drupalcode.org/project/block_permissions.git", - "reference": "8.x-1.2" + "reference": "8.x-1.3" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/block_permissions-8.x-1.2.zip", - "reference": "8.x-1.2", - "shasum": "45c63cf14da18d82c73049c8dcdf90fde6a107b5" + "url": "https://ftp.drupal.org/files/projects/block_permissions-8.x-1.3.zip", + "reference": "8.x-1.3", + "shasum": "f12967eba6498a77249836849b4245c98af60867" }, "require": { - "drupal/core": "^8 || ^9" + "drupal/core": "^9.3 || ^10" }, "type": "drupal-module", "extra": { "drupal": { - "version": "8.x-1.2", - "datestamp": "1617805905", + "version": "8.x-1.3", + "datestamp": "1680965820", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php index a72151c77c..7824d8f7ea 100644 --- a/vendor/composer/ClassLoader.php +++ b/vendor/composer/ClassLoader.php @@ -45,35 +45,34 @@ class ClassLoader /** @var \Closure(string):void */ private static $includeFile; - /** @var ?string */ + /** @var string|null */ private $vendorDir; // PSR-4 /** - * @var array[] - * @psalm-var array<string, array<string, int>> + * @var array<string, array<string, int>> */ private $prefixLengthsPsr4 = array(); /** - * @var array[] - * @psalm-var array<string, array<int, string>> + * @var array<string, list<string>> */ private $prefixDirsPsr4 = array(); /** - * @var array[] - * @psalm-var array<string, string> + * @var list<string> */ private $fallbackDirsPsr4 = array(); // PSR-0 /** - * @var array[] - * @psalm-var array<string, array<string, string[]>> + * List of PSR-0 prefixes + * + * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2'))) + * + * @var array<string, array<string, list<string>>> */ private $prefixesPsr0 = array(); /** - * @var array[] - * @psalm-var array<string, string> + * @var list<string> */ private $fallbackDirsPsr0 = array(); @@ -81,8 +80,7 @@ class ClassLoader private $useIncludePath = false; /** - * @var string[] - * @psalm-var array<string, string> + * @var array<string, string> */ private $classMap = array(); @@ -90,21 +88,20 @@ class ClassLoader private $classMapAuthoritative = false; /** - * @var bool[] - * @psalm-var array<string, bool> + * @var array<string, bool> */ private $missingClasses = array(); - /** @var ?string */ + /** @var string|null */ private $apcuPrefix; /** - * @var self[] + * @var array<string, self> */ private static $registeredLoaders = array(); /** - * @param ?string $vendorDir + * @param string|null $vendorDir */ public function __construct($vendorDir = null) { @@ -113,7 +110,7 @@ public function __construct($vendorDir = null) } /** - * @return string[] + * @return array<string, list<string>> */ public function getPrefixes() { @@ -125,8 +122,7 @@ public function getPrefixes() } /** - * @return array[] - * @psalm-return array<string, array<int, string>> + * @return array<string, list<string>> */ public function getPrefixesPsr4() { @@ -134,8 +130,7 @@ public function getPrefixesPsr4() } /** - * @return array[] - * @psalm-return array<string, string> + * @return list<string> */ public function getFallbackDirs() { @@ -143,8 +138,7 @@ public function getFallbackDirs() } /** - * @return array[] - * @psalm-return array<string, string> + * @return list<string> */ public function getFallbackDirsPsr4() { @@ -152,8 +146,7 @@ public function getFallbackDirsPsr4() } /** - * @return string[] Array of classname => path - * @psalm-return array<string, string> + * @return array<string, string> Array of classname => path */ public function getClassMap() { @@ -161,8 +154,7 @@ public function getClassMap() } /** - * @param string[] $classMap Class to filename map - * @psalm-param array<string, string> $classMap + * @param array<string, string> $classMap Class to filename map * * @return void */ @@ -179,24 +171,25 @@ public function addClassMap(array $classMap) * Registers a set of PSR-0 directories for a given prefix, either * appending or prepending to the ones previously set for this prefix. * - * @param string $prefix The prefix - * @param string[]|string $paths The PSR-0 root directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix + * @param list<string>|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories * * @return void */ public function add($prefix, $paths, $prepend = false) { + $paths = (array) $paths; if (!$prefix) { if ($prepend) { $this->fallbackDirsPsr0 = array_merge( - (array) $paths, + $paths, $this->fallbackDirsPsr0 ); } else { $this->fallbackDirsPsr0 = array_merge( $this->fallbackDirsPsr0, - (array) $paths + $paths ); } @@ -205,19 +198,19 @@ public function add($prefix, $paths, $prepend = false) $first = $prefix[0]; if (!isset($this->prefixesPsr0[$first][$prefix])) { - $this->prefixesPsr0[$first][$prefix] = (array) $paths; + $this->prefixesPsr0[$first][$prefix] = $paths; return; } if ($prepend) { $this->prefixesPsr0[$first][$prefix] = array_merge( - (array) $paths, + $paths, $this->prefixesPsr0[$first][$prefix] ); } else { $this->prefixesPsr0[$first][$prefix] = array_merge( $this->prefixesPsr0[$first][$prefix], - (array) $paths + $paths ); } } @@ -226,9 +219,9 @@ public function add($prefix, $paths, $prepend = false) * Registers a set of PSR-4 directories for a given namespace, either * appending or prepending to the ones previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param string[]|string $paths The PSR-4 base directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param list<string>|string $paths The PSR-4 base directories + * @param bool $prepend Whether to prepend the directories * * @throws \InvalidArgumentException * @@ -236,17 +229,18 @@ public function add($prefix, $paths, $prepend = false) */ public function addPsr4($prefix, $paths, $prepend = false) { + $paths = (array) $paths; if (!$prefix) { // Register directories for the root namespace. if ($prepend) { $this->fallbackDirsPsr4 = array_merge( - (array) $paths, + $paths, $this->fallbackDirsPsr4 ); } else { $this->fallbackDirsPsr4 = array_merge( $this->fallbackDirsPsr4, - (array) $paths + $paths ); } } elseif (!isset($this->prefixDirsPsr4[$prefix])) { @@ -256,18 +250,18 @@ public function addPsr4($prefix, $paths, $prepend = false) throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); } $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; + $this->prefixDirsPsr4[$prefix] = $paths; } elseif ($prepend) { // Prepend directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( - (array) $paths, + $paths, $this->prefixDirsPsr4[$prefix] ); } else { // Append directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( $this->prefixDirsPsr4[$prefix], - (array) $paths + $paths ); } } @@ -276,8 +270,8 @@ public function addPsr4($prefix, $paths, $prepend = false) * Registers a set of PSR-0 directories for a given prefix, * replacing any others previously set for this prefix. * - * @param string $prefix The prefix - * @param string[]|string $paths The PSR-0 base directories + * @param string $prefix The prefix + * @param list<string>|string $paths The PSR-0 base directories * * @return void */ @@ -294,8 +288,8 @@ public function set($prefix, $paths) * Registers a set of PSR-4 directories for a given namespace, * replacing any others previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param string[]|string $paths The PSR-4 base directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param list<string>|string $paths The PSR-4 base directories * * @throws \InvalidArgumentException * @@ -481,9 +475,9 @@ public function findFile($class) } /** - * Returns the currently registered loaders indexed by their corresponding vendor directories. + * Returns the currently registered loaders keyed by their corresponding vendor directories. * - * @return self[] + * @return array<string, self> */ public static function getRegisteredLoaders() { diff --git a/vendor/composer/InstalledVersions.php b/vendor/composer/InstalledVersions.php index c6b54af7ba..51e734a774 100644 --- a/vendor/composer/InstalledVersions.php +++ b/vendor/composer/InstalledVersions.php @@ -98,7 +98,7 @@ public static function isInstalled($packageName, $includeDevRequirements = true) { foreach (self::getInstalled() as $installed) { if (isset($installed['versions'][$packageName])) { - return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']); + return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false; } } @@ -119,7 +119,7 @@ public static function isInstalled($packageName, $includeDevRequirements = true) */ public static function satisfies(VersionParser $parser, $packageName, $constraint) { - $constraint = $parser->parseConstraints($constraint); + $constraint = $parser->parseConstraints((string) $constraint); $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); return $provided->matches($constraint); @@ -328,7 +328,9 @@ private static function getInstalled() if (isset(self::$installedByVendor[$vendorDir])) { $installed[] = self::$installedByVendor[$vendorDir]; } elseif (is_file($vendorDir.'/composer/installed.php')) { - $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php'; + /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */ + $required = require $vendorDir.'/composer/installed.php'; + $installed[] = self::$installedByVendor[$vendorDir] = $required; if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { self::$installed = $installed[count($installed) - 1]; } @@ -340,12 +342,17 @@ private static function getInstalled() // only require the installed.php file if this file is loaded from its dumped location, // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 if (substr(__DIR__, -8, 1) !== 'C') { - self::$installed = require __DIR__ . '/installed.php'; + /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */ + $required = require __DIR__ . '/installed.php'; + self::$installed = $required; } else { self::$installed = array(); } } - $installed[] = self::$installed; + + if (self::$installed !== array()) { + $installed[] = self::$installed; + } return $installed; } diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 2fcf345706..2877fd55f3 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -2195,27 +2195,27 @@ }, { "name": "drupal/block_permissions", - "version": "1.2.0", - "version_normalized": "1.2.0.0", + "version": "1.3.0", + "version_normalized": "1.3.0.0", "source": { "type": "git", "url": "https://git.drupalcode.org/project/block_permissions.git", - "reference": "8.x-1.2" + "reference": "8.x-1.3" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/block_permissions-8.x-1.2.zip", - "reference": "8.x-1.2", - "shasum": "45c63cf14da18d82c73049c8dcdf90fde6a107b5" + "url": "https://ftp.drupal.org/files/projects/block_permissions-8.x-1.3.zip", + "reference": "8.x-1.3", + "shasum": "f12967eba6498a77249836849b4245c98af60867" }, "require": { - "drupal/core": "^8 || ^9" + "drupal/core": "^9.3 || ^10" }, "type": "drupal-module", "extra": { "drupal": { - "version": "8.x-1.2", - "datestamp": "1617805905", + "version": "8.x-1.3", + "datestamp": "1680965820", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -2228,10 +2228,6 @@ "GPL-2.0+" ], "authors": [ - { - "name": "Steven Buteneers", - "homepage": "https://www.drupal.org/user/3301055" - }, { "name": "jefuri", "homepage": "https://www.drupal.org/user/2733365" @@ -2243,6 +2239,10 @@ { "name": "sinn", "homepage": "https://www.drupal.org/user/682600" + }, + { + "name": "Steven Buteneers", + "homepage": "https://www.drupal.org/user/3301055" } ], "description": "Adds specific permissions for administering blocks.", diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 088738fa4f..3bfc393628 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' => 'bbc324b913982bc5f7acfcabab8daa2200f6622b', + 'reference' => '52c5f239f26a10cfa3c2d3933c105ad12c2230cf', 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -335,9 +335,9 @@ 'dev_requirement' => false, ), 'drupal/block_permissions' => array( - 'pretty_version' => '1.2.0', - 'version' => '1.2.0.0', - 'reference' => '8.x-1.2', + 'pretty_version' => '1.3.0', + 'version' => '1.3.0.0', + 'reference' => '8.x-1.3', 'type' => 'drupal-module', 'install_path' => __DIR__ . '/../../web/modules/block_permissions', 'aliases' => array(), @@ -1549,7 +1549,7 @@ 'osu-asc-webservices/d8-upstream' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => 'bbc324b913982bc5f7acfcabab8daa2200f6622b', + 'reference' => '52c5f239f26a10cfa3c2d3933c105ad12c2230cf', 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), diff --git a/web/modules/block_permissions/README.txt b/web/modules/block_permissions/README.md similarity index 68% rename from web/modules/block_permissions/README.txt rename to web/modules/block_permissions/README.md index e586f4be6a..ebce7982f1 100644 --- a/web/modules/block_permissions/README.txt +++ b/web/modules/block_permissions/README.md @@ -1,14 +1,13 @@ -CONTENTS OF THIS FILE ---------------------- +## CONTENTS OF THIS FILE - * Introduction - * Requirements - * Installation - * Configuration - * Maintainers + - Introduction + - Requirements + - Installation + - Configuration + - Maintainers + +## INTRODUCTION -INTRODUCTION ------------- This module provides additional permissions for finer grained permissions in managing blocks. @@ -23,20 +22,17 @@ The following permissions are added: This enables granting a user permission to add certain types of blocks but not system block plugins. -REQUIREMENTS ------------- +## REQUIREMENTS No requirements for this module. -INSTALLATION ------------- +## INSTALLATION - * Install as you would normally install a contributed Drupal module. See: - https://drupal.org/documentation/install/modules-themes/modules-8 + - Install as you would normally install a contributed Drupal module. See: + <https://www.drupal.org/docs/extending-drupal/installing-modules> for further information. -CONFIGURATION -------------- +## CONFIGURATION After enabling this module users without the specific permissions will not be able to manage the blocks, even if they have the permission to administer the @@ -48,8 +44,8 @@ For Block layout page (/admin/structure/block) permission 'administer blocks' is permission to administer block settings for the default theme also. -MAINTAINERS ------------ +## MAINTAINERS Current maintainers: - * Michiel Nugter - https://www.drupal.org/user/1023784 + * Michiel Nugter - <https://www.drupal.org/user/1023784> + * Evgenii Nikitin - <https://www.drupal.org/u/sinn> diff --git a/web/modules/block_permissions/block_permissions.info.yml b/web/modules/block_permissions/block_permissions.info.yml index 0d0bfc479f..4c51608381 100644 --- a/web/modules/block_permissions/block_permissions.info.yml +++ b/web/modules/block_permissions/block_permissions.info.yml @@ -2,10 +2,9 @@ name: 'Block Permissions' type: module description: 'Adds specific permissions for administering blocks.' package: Block -core: '8.x' -core_version_requirement: ^8 || ^9 +core_version_requirement: ^9.3 || ^10 -# Information added by Drupal.org packaging script on 2021-04-07 -version: '8.x-1.2' +# Information added by Drupal.org packaging script on 2023-04-08 +version: '8.x-1.3' project: 'block_permissions' -datestamp: 1617805907 +datestamp: 1680965779 diff --git a/web/modules/block_permissions/src/BlockPermissionsAccessControlHandler.php b/web/modules/block_permissions/src/BlockPermissionsAccessControlHandler.php index d744c5ecd8..2d337097c9 100644 --- a/web/modules/block_permissions/src/BlockPermissionsAccessControlHandler.php +++ b/web/modules/block_permissions/src/BlockPermissionsAccessControlHandler.php @@ -43,7 +43,7 @@ public static function create(ContainerInterface $container) { return new static( $container->get('plugin.manager.block'), $container->get('current_user'), - $container->get('config.factory'), + $container->get('config.factory') ); } diff --git a/web/modules/block_permissions/tests/src/Functional/BlockFormRoutesAccessTest.php b/web/modules/block_permissions/tests/src/Functional/BlockFormRoutesAccessTest.php index 8822732522..527eba8dc6 100644 --- a/web/modules/block_permissions/tests/src/Functional/BlockFormRoutesAccessTest.php +++ b/web/modules/block_permissions/tests/src/Functional/BlockFormRoutesAccessTest.php @@ -221,7 +221,7 @@ protected function getBlockAdminAddUrl($id, $theme) { * Page title. */ protected function getBlockDeleteFormTitle($name) { - return new FormattableMarkup('Are you sure you want to remove the block @name?', ['@name' => $name]); + return new FormattableMarkup('Are you sure you want to remove the block @name from the Content region?', ['@name' => $name]); } } diff --git a/web/modules/block_permissions/tests/src/Functional/BlockPermissionsBrowserTestBase.php b/web/modules/block_permissions/tests/src/Functional/BlockPermissionsBrowserTestBase.php index 0fa3bb0c3a..6ebc5caaae 100644 --- a/web/modules/block_permissions/tests/src/Functional/BlockPermissionsBrowserTestBase.php +++ b/web/modules/block_permissions/tests/src/Functional/BlockPermissionsBrowserTestBase.php @@ -27,7 +27,7 @@ abstract class BlockPermissionsBrowserTestBase extends BrowserTestBase { * * @var string */ - protected $secondTheme = 'bartik'; + protected $secondTheme = 'olivero'; /** * Page title block. -- GitLab