Install
Works with Drupal: ^10.3 || ^11 || ^12Using Composer to manage Drupal site dependencies
Alternative installation files
Download tar.gz
62.05 KB
MD5: 7c635ab93946efb63b36390df643064e
SHA-1: ed7923173809167bb0a19a3b249bd698004aca60
SHA-256: 8af3571f1bd4346778d9026c54bb9f6a1c6b5bf1d22836dc229c127794104ba3
Download zip
120.32 KB
MD5: 3d285467bf349f315d76720a0abfb27d
SHA-1: 275ad00d2f369685741ed395c5384f6f589db4a5
SHA-256: 718b56f1d582455e8c0c6725d6580b51b914bb69f8c16d975dd68c91e80d08a8
Release notes
Key 8.x-1.23 adds Drupal 12 support and fixes a long list of bugs in key values, providers, forms and configuration overrides. Drupal 10.3 is now the minimum supported core version; Drupal 9 and Drupal 10.0 to 10.2 are no longer supported.
Highlights:
- Key's own plugins are now defined with PHP attributes (
#[KeyType],#[KeyProvider],#[KeyInput]). Plugins in other modules that still use annotations keep working. - Key values are cached per request in a memory cache that is cleared when a key is saved or deleted, so a changed value is no longer stale for the rest of the request.
- Key configuration overrides no longer stop working for the rest of a request after an empty lookup or an error, and the override mapping is cached instead of being rebuilt on every request.
- The Environment provider also reads variables from
$_ENV(for example those loaded by symfony/dotenv), and accepts0as a value. - The key edit, delete and add routes now respect entity access hooks.
Upgrade notes
- Core requirement:
core_version_requirementis now^10.3 || ^11 || ^12. - KeyListBuilder::getOperations() gained an optional
?CacheableMetadata $cacheability = NULLparameter, matching Drupal 12 core. Subclasses that overridegetOperations()must add the same parameter. - KeyInterface::getKeyValue() and getKeyValues() now declare the optional
$reset = FALSEparameter that the Key entity already had. Classes that implementKeyInterfacedirectly, rather than extendingKey, must add it. - Key::setKeyValue() now throws
\InvalidArgumentExceptionwhen an array is passed for a key type that does not support multiple values. - FileKeyProvider::__construct() accepts an optional
$file_systemargument. Omitting it is deprecated in key:1.23.0 and it will be required in key:2.0.0. See the change record. - Key values that are not available are NULL.
KeyProviderInterface::getKeyValue()andKeyInterface::getKeyValue()now documentstring|null. Configuration overrides are skipped when a key's value is NULL. - Route access: the key and key override add, edit and delete routes use entity access checks. Without access hooks, the required permissions are unchanged.
- Override mapping cache: overrides saved or deleted through the entity API (including configuration import) take effect immediately. Overrides changed as raw configuration, for example with
drush cset, take effect after a cache rebuild.
Contributors (12)
japerry, Rajeshreeputra, mxr576, aaronbauman, Ankit_K, aryan_singh, dewalt, doxigo, Ranjit1032002, rlhawk, SpadXIII, svendecabooter
Changelog
Issues: 20 issues resolved.
Changes since 8.x-1.22 (compare):
Bug
- #2985590 by Rajeshreeputra, japerry, mxr576, rlhawk: Static cache does not get invalidated
- #3247492 by japerry: Processed values issue empty string
- #3300224 by Rajeshreeputra, japerry: Key file not loaded when Stream Wrapper is used for file location before Drupal bootstrap completes
- #3356052 by Ranjit1032002, mxr576, Rajeshreeputra, japerry: KeyProviderInterface::getKeyValue() doesn't always return a string
- #3391000 by SpadXIII, Rajeshreeputra, japerry: Key config overrides queries mapping every config override each time
- #3463277 by japerry: KeyInterface::getKeyValue() invoked with 1 parameter, 0 required
- #3550470 by doxigo, japerry: Key Multivalue Key Type: JSON decode accepts NULL, triggers PHP 8.1 deprecation
- #3568554 by aryan_singh, japerry: Route access checking on delete/edit routes ignores entity access
- #3588460 by japerry: Follow-up: tighten form object and plugin typing in Key configuration plugins
- #3605642 by japerry: Non-numeric custom encryption key size causes a fatal TypeError
- #3612252 by dewalt, japerry: Zero is ignored by Environment key provider
- #3619821 by japerry: Changing a key type's key_value.plugin regenerates existing keys on next save
Feature
- #3280401 by japerry: Key value maxlength
- #3576207 by Ankit_K, japerry: Env variable: obtain from $_ENV
Task
- #3101908 by Rajeshreeputra, japerry: Provide a form description for KeyInput forms
- #3395817 by Rajeshreeputra, japerry: Key::setKeyValue can accept array, documented as only accepting string
- #3424650 by japerry: Minor UI suggestion - add some explanatory text on how to set environment variables
- #3522907 by Rajeshreeputra, japerry: Document how 'Overriding Configuration' is intended to work
- #3591924 by aaronbauman, japerry: Autowire aliases for Key services
- #3632542 by japerry, svendecabooter: Automated Drupal 12 compatibility fixes for key 8.x-1.x-dev