Install

Works with Drupal: ^10.3 || ^11

Using Composer to manage Drupal site dependencies

Alternative installation files

Download tar.gz 1.33 MB
MD5: 7d973175da4c7c1b26ede6327b6602bf
SHA-1: 2318f208366b0c4b65ebcf6ed3f6b1a805ecb619
SHA-256: 24f6e59108c5570e3d84af6ed76b03d5d16766dc8608f355218b36c1358d3fab
Download zip 1.72 MB
MD5: a82149e2261acc7dcd2b794278b0faa9
SHA-1: ccace0d3533ffed3e13225411d5aa624f6356c2a
SHA-256: 2cda670c16d339ff0aafa95bfc7cbd422b9f8069cdfe6e583a5b8cf7827f45a9

Release notes

Patternkit 9.1.3 helps editors catch content errors while they work in Layout Builder and reuse the image details their media teams have already written. For existing sites, the release adds background validation and a way to fill gaps in image alt text across blocks.

  • Catch errors before saving. When validation blocks a save, editors see feedback beside the Add block or Update button. Sites that need a gradual rollout can warn editors and let them save on a second submission.
  • Enter image details once. Select an image from Media Library or paste a matching image URL to fill supported fields with the media item’s alt text, title, and dimensions. For existing blocks, administrators can backfill missing alt text in bulk and schedule that work outside a deployment.
  • Keep edits intact. CKEditor preserves HTML changes made in source mode. Supported Drupal tokens now work in fields that expect a formatted value, such as a URL.
  • Keep validation current. Background checks revisit stored blocks as schemas change, and a block with a missing pattern no longer holds up the scan for others. Patternkit reuses schemas within a request to reduce repeated validation work.

Changelog

Changes since 9.1.2 (compare tags).

Bug

  • #3620055: Automatic image-alt backfill can time out deployments without a supported opt-out
  • #3620054: Display validation feedback on JSON Editor validation failure
  • #3526079: Allow attachments in media processor
  • #3620053: Cron: stale block validation never refreshes when another block references a missing pattern
  • #3541532: Cannot install because trait LayoutEntityHelperTrait missing
  • #3547300: Patternkit Blocks Always Report 'user' Context
  • #3608391: Property conflict in LayoutHelper causes error
    • #3616897: Installation fails in Drupal 11.3 with Fatal error
  • #3578041: Property conflict in LayoutQueueWorkerBase causes error during cron jobs
  • #3604089: Drupal 11.4 compatibility: adapt PatternLibraryParserBase for YamlCacheCollector constructor change
  • !176: Override JSON Editor purify() to prevent CKEditor HTML stripping
  • !178: fix: Fix bugs in CKEditor5 integration around handling source editing mode correctly
  • #3576066: Refresh JSON Editor schema when "Update pattern" is clicked in Layout Builder block config
  • #3577380: Fix beforeSubmit form value lookup in patternkit.jsoneditor.js
  • #3574404: Enforce non-empty values for required string fields in JSON Editor forms
  • #3593600: Duplicate "Value required" error when required string field also declares minLength: 1
  • #3585847: Allow Drupal tokens and editor-inserted placeholder values in format-constrained Patternkit block fields
  • #3593772: Media library selection only populates sibling image attributes for *.image.src keys
  • #3605768: SchemaFactory static cache allows format validation bypass to persist across PHP-FPM requests
    • The fix scopes caches to each factory instance. Repeated validations using the same cached schema within one request can still share format changes.
  • #3580369: Fix config schema for dynamic patternkit_libraries keys to prevent settings-save warnings
  • #3542307: Inconsistent Patternkit JSON Editor "Add block" button styling in Drupal 11 compared to Drupal 10
  • #3615303: Reusable blocks deprecation warning suppressed when enable_reusable_blocks is enabled

Feature

  • #3589846: Add validity stamp infrastructure and save-time validation enforcement for PatternkitBlock entities
    • #3594479: Make client-side JSON Editor validation toggle-aware for editorial workflows
    • #3610739: Add parent entity columns to patternkit_block_validity for cleanup and orphan detection
    • #3620050: Config-placed patternkit blocks incorrectly record pending parent resolution state
  • #3556232: Auto-populate image alt text and attributes from pasted URLs
  • #3561082: Bulk Update Missing Image Data
  • #3572072: Request-scoped schema caching in SchemaFactory to reduce validation overhead

Misc

  • !172: Update Composer and DDev Dependencies
  • !192: feat: Add linting toolchain (ESLint, Prettier, markdownlint, cspell) with CI enforcement
  • !200: docs: Add DEVELOPMENT.md for DDEV local development setup
  • #3453875: Test Validation of Required Fields within Schema in Patternkit
  • !170: Fix ValidationCommandsTest for Drush 13 output routing
  • !175: fix: Refine PHPStan stubs for JSWebAssert usage.
  • !186: Stabilize CKEditor source-mode save FunctionalJavascript test
  • #3612106: PHPStan CI fails on 9.1.x after phpstan-drupal package update
  • !208: fix: Honor _COMPOSER_YARN_INSTALL in composer after_script

Task

  • #3608056: Update Drupal 11.4 Hook Attribute Compatibility
  • #3609394: Remove PHP 8.4 #[\Deprecated] attributes that cause excessive runtime deprecation noise
  • !177: fix: Pin JSON Editor version for consistency in all environments
  • #3587400: Remove Dead JS Dependency: AJV
  • #3587714: Revert Reusable Block Support Removal Until Later Release

Upgrade notes

Composer and Layout Builder

Patternkit bundles JSON Editor. Its npm package is a development dependency in 9.1.3, so installing Patternkit no longer requires Asset Packagist for JSON Editor. If other packages use Asset Packagist, keep that repository configured.

Confirm Layout Builder is enabled.

Media Library alt-text backfill before database updates

When Patternkit Media Library is enabled and its alt-text post-update is pending, the update scans existing Patternkit blocks for missing image alt text. If the scan could exceed your deployment window, add this setting to settings.php before running database updates:

$settings['patternkit_media_library_skip_alt_text_post_update'] = TRUE;

Drupal records the skipped post-update as complete. Removing the setting later leaves it complete. Use drush pk-alt to run the backfill separately. See #3620055.

Run database updates

Run normal database updates and rebuild caches.

Content editors and administrators: save-time validation

The Prevent saving invalid pattern content setting defaults on. The update preserves explicitly configured values. With enforcement enabled, invalid Add block and Update submissions show a message beside the action explaining that the block cannot be saved. The message remains while validation errors persist and clears after correction. With enforcement disabled, the editor warns before permitting a second submission with issues. Direct entity saves are not universally blocked by this setting.

Sites with existing invalid content not ready for enforcement may need to disable this setting on update. This may be configured on the administrative Patternkit settings form.

Sites with existing invalid content: remediation remains separate

Existing invalid content is not automatically repaired. The initial render-time enforcement was reverted. This release establishes validation and tracking; the remediation dashboard and stamp-aware render policy remain follow-up work.

Sites using reusable blocks: deprecated opt-in remains available

Reusable blocks remain deprecated and unsupported. Removal is deferred because migration tooling and the pathway for existing placements are unfinished. See the existing deprecation record and migration/removal follow-up.

Sites that need to continue using this legacy functionality during the migration window can enable it in their loaded site-level services.yml:

parameters:
  patternkit.config:
    features:
      enable_reusable_blocks: true

Merge this setting with existing Patternkit parameters rather than replacing other feature overrides, then rebuild caches. This opt-in retains deprecated functionality and does not provide migration tooling or restore supported status.

Known limitations

  • Editor and server validation can produce different results for required strings.
    • The editor rejects empty or whitespace-only required strings. Server-side JSON Schema validation checks property presence; schema authors can add explicit constraints such as minLength where appropriate.
    • #3574404: Required-string behavior and schema-author guidance.
  • Token support for format-constrained fields does not bypass arbitrary regex constraints.
    • #3585847: Supported tokens/placeholders and the remaining pattern constraint boundary.
  • Background validation uses a different schema reference from placement saves.
    • Cron checks the current default pattern schema; placement saves use the associated pattern revision.
    • #3589846, implementation discussion: Background scanning and stamp context.
  • Cron-discovered validity stamps can lack layout-placement context.
    • Pending context does not establish that a block is orphaned. Config-placed blocks use a separate not-applicable state.
    • #3610739: Placement metadata.
    • #3620050: Config-placement resolution states.
  • Repeated server-side validations using the same cached schema within one request can share format changes after an earlier token or empty value bypasses a format check. #3605768
  • Image population depends on available matching media metadata.
    • It does not create missing source information or guarantee complete alt text.
    • #3556232: Pasted-URL population and unmatched-media cases.
    • #3561082: Bulk population for existing blocks.
  • #3620052: Stamps have been reported to remain after content is unpublished, translations are deleted, or blocks are removed from layouts. Investigation and cleanup follow-up remain open.

Change records

References

Created by: slucero
Created on: 18 Nov 2026 at 19:29 UTC
Last updated: 18 Nov 2026 at 19:29 UTC
Bug fixes
New features

Other releases