Bulk Pattern Updates and Usage Tracking Don't Cover Non-Default Entity Translations

Created on 26 February 2024, 4 months ago
Updated 8 April 2024, 3 months ago

Problem/Motivation

On a site using node translations, per-node layout overrides, and Layout Builder Asymmetric Translations β†’ , patterns in non-default translations were not updated or detected in usage tracking.

Steps to reproduce

  • Install the following modules:
    • patternkit
    • patternkit_example
    • patternkit_usage_tracking
    • devel
    • patternkit_devel
    • layout_builder
    • language
    • content_translation
    • layout_builder_at
  • Configure Patternkit with Layout Builder enabled on a content type with per-node layout overrides
  • Configure a second language on the site
  • Enable translation on the configured content type with translation for the layout field
  • Create several test pages with unique layouts and Patternkit blocks placed on them
  • Create translations for several of the test pages with separate layouts and Patternkit blocks
  • Delete any existing usage tracking from content creation: drush edel -y pattern_usage
  • Run usage detection to identify patterns in created content: drush pkuscan
  • Review discovered patterns on the pattern usage report at /admin/reports/pattern-usage
    • Expect to see all pattern usages across all translations
  • If the new fix is installed, you may also review the processed displays using the new Drush command: drush pkuscan-results
    • The output listed here should include displays in both the original and translated languages
  • Run the Drush command to mark existing blocks as needing updates: drush pkbu
    • Expect to see displays listed in output for Nodes in both original languages and translations
  • Spot-check by editing blocks in layouts on both original languages and translations expecting the edit form to NOT prompt for updates to the pattern
  • If the new fix is installed, you may also review the processed displays using the new Drush command: drush pkbu-results
    • The output listed here should include displays in both the original and translate languages

Proposed resolution

During batch processing while displays are being discovered, load and queue available translations. The need for this is related to πŸ› Entity query not working with multiple languages. Active and a related strategy to circumvent it may be found here.

Remaining tasks

User interface changes

  • New Drush commands available to view a listing of results from the last execution of the related batch processing command:
    • drush pkbu-results: View the list of updated displays and blocks during the last execution of drush pkbu
    • drush pkuscan-results: View the list of process displays and blocks during the last execution of drush pkuscan

API changes

None

Data model changes

  • New tempstore values for patternkit.update and patternkit.usage_scan to record results of the last batch processing operation.
πŸ› Bug report
Status

Fixed

Version

9.1

Component

Module Core

Created by

πŸ‡ΊπŸ‡ΈUnited States slucero Arkansas

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.69.0 2024