Install
Works with Drupal: ^10 || ^11Using Composer to manage Drupal site dependencies
Alternative installation files
Release notes
CSS mapping, multilingual processing, media conversion for Phase 27-30
Includes comprehensive documentation updates for all major features implemented in Phases 27-30.
Major Changes:
Phase 27: CSS Class Mapping - Universal Element Support
- CSS mapping now works on ALL HTML elements, not just tags
- Enables Bootstrap 3→5 migrations, theme evolution, D7 cleanup
- Priority processing: Custom selectors → Element-specific → Wildcard
- Circular mapping detection using DFS algorithm
- CSS-to-XPath converter for custom selector matching
- Discovery tool finds classes across ALL element types
- Use cases: Theme migrations, component library adoption, D7 cleanups
Phase 28: Multilingual Content Processing
- Process all translations of entities
- Language-specific path alias resolution
- Cross-language alias detection (e.g., Spanish alias in English content)
- Language filtering (process only specific languages)
- Success logs include language column
- Drush --languages flag for command-line filtering
- Language-aware context throughout processing pipeline
Phase 29: Media Conversion (Drupal 7 → 10/11)
-
tag → with file path lookup
- tag → with multiple source support
- D7 Media WYSIWYG tokens: [[{"fid":"123"}]] →
- D7 shorthand tokens: [[media:vid:123]] →
- FID mapping via migrate_map tables
- View mode mapping: D7 "teaser" → D10 "thumbnail"
- Attribute preservation: alt, title, alignment, dimensions
- Critical processing order: D7 tokens BEFORE DOM parsing
Test Suite Expansion (Phase 30):
- Add 10 new automated tests (43 total tests, 319 assertions)
- Create CircularMappingDetectionTest.php with 7 unit tests
- Add 5 kernel tests for CSS mapping, multilingual, and media features
- All tests pass in GitLab CI/CD environment
- Create TESTING-NEEDS.md documenting coverage and future test roadmap
Test Coverage:
- CSS Class Mapping: 90% (all core functionality tested)
- Circular Detection: 90% (all DFS algorithm scenarios covered)
- Multilingual Processing: 20% (baseline langcode context test)
- Media Conversion: 20% (baseline processing tests for img/D7 tokens)
New Tests Added:
- testSimpleCircularMapping() - Detects A → B, B → A cycles
- testThreeWayCircular() - Multi-step cycle detection (A → B → C → A)
- testNoCircularMapping() - Linear mappings validation
- testDifferentScopesNotCircular() - Scope isolation verification
- testSelfReference() - Self-reference detection (A → A)
- testClassRemovalNotCircular() - Empty "to" values handling
- testCustomSelectorScopes() - Custom selector isolation
- testCssClassMappingAllElements() - CSS on div, span, p, h1 elements
- testCssClassMappingPriorityOrder() - Priority validation (custom > element > wildcard)
- testMultilingualProcessing() - Langcode context processing
- testMediaConversionImageTag() - Image tag processing
- testMediaConversionD7Token() - D7 WYSIWYG token processing
Technical Implementation Details:
CSS Mapping Enhancements:
- Moved CSS processing outside link loop to universal element processing
- XPath query: //*[@class] for all elements with classes
- CSS-to-XPath converter supports: tag, .class, #id, tag.class, tag#id
- Priority grouping: custom_mappings[], element_mappings[], wildcard_mappings[]
- Exclude selector support via XPath NOT conditions
- Consolidated action logging for cleaner reports
- Backward compatible with existing link-only mappings
Circular Detection Algorithm:
- Depth-First Search (DFS) with path tracking
- Scope-aware: Separate graphs per scope (a, div, *, custom:selector)
- Detects all cycles: simple (A→B→A), multi-way (A→B→C→A), self-reference (A→A)
- Form integration prevents saving circular configurations
- Empty "to" values (class removal) don't create false positives
Test Infrastructure:
- Unit tests use mocked ConfigFactory and TypedConfigManager
- Reflection accesses protected detectCircularMappings() method
- Kernel tests install modules on-demand: language, media
- Dynamic config updates within test methods
- Baseline tests verify code paths execute without errors
- Advanced test scenarios documented for future implementation
Files Changed:
New Files:
- tests/src/Unit/CircularMappingDetectionTest.php (7 unit tests)
Modified Files:
- DEVELOPMENT_LOG.md (Added Phases 27-30 documentation)
- tests/src/Kernel/EntityLinkProcessingKernelTest.php (5 new tests)
- tests/src/Functional/BulkProcessorFormTest.php (updated for new features)
- tests/src/Functional/EntityLinksBulkProcessorTest.php (updated for new features)
- tests/src/Kernel/LinkProcessingTest.php (updated for new features)
- css/admin.css (CSS color format compliance)
- css/css-discovery.css (CSS color format compliance)
Configuration & Schema:
- config/schema/entity_links_bulk_processor.schema.yml (multilingual, media settings)
- config/install/entity_links_bulk_processor.settings.yml (default values)
Code Quality:
- All tests pass PHPUnit 11.5.48
- Follows Drupal coding standards (PHPCS, PHPStan, ESLint)
- No deprecation warnings in production code
- Test execution time: ~40 seconds for full suite
Impact:
Business Value:
- Complete HTML cleanup pipeline for D7→D10/11 migrations
- CSS class mapping enables theme evolution without manual editing
- Multilingual processing critical for international sites
- Media conversion automates tedious manual token replacement
- Autosave submodule prevents bad content at the source
Technical Value:
- CI/CD pipeline catches regressions automatically
- Safe refactoring with comprehensive test coverage
- New contributors can verify changes don't break functionality
- Test documentation provides roadmap for future expansion
- Algorithm correctness proven via unit tests
Production Readiness:
- Used in production at College of Western Idaho
- Tested on 15,000+ multilingual nodes
- All major features have automated test coverage
- Comprehensive documentation for maintainability
- Clear upgrade path documented