[#3561082] Add bulk alt text population for pattern blocks.

[#3561082] Add bulk alt text population for pattern blocks.

Implement automated bulk processing to populate missing alt text in pattern blocks by looking up media entity attributes.

New Services:

  • ContentImageFieldLocator: Traverses pattern schemas to identify image fields with missing or empty alt text
  • BlockAltTextUpdater: Processes individual blocks and updates content with alt text from media entities

Features:

  • Drush command (pkm-alt) with --dry-run and --limit options
  • Post-update hook for automatic batch processing on updates
  • Support for both flat (src/alt) and nested (image.src/image.alt) fields
  • Handles multiple image field naming patterns (_url, _src, _uri)

Testing:

  • 24 comprehensive unit tests for ContentImageFieldLocator
  • Test data generation script for manual testing
  • All tests passing with webRh patterns (Image atom, Simple Image)

Technical Details:

  • Uses Drupal NestedArray utility for array traversal
  • PHP 8 constructor property promotion
  • Follows Drupal coding standards
  • Proper error handling and logging

Closes #3561082

Merge request reports

Loading