Language conditions do not match the expected context.

Drupal\notification_message\EventSubscriber\getContextsFromRepository() returns a Language context with the key of "language_interface"

Whereas Drupal\notification_message\Entity->getRequiredContexts() returns a key of "language".

This mismatch causes the context condition to be excluded from the results of Drupal\notification_message\Entity->extractRequiredContexts()

Steps to Reproduce

  1. Configure a site for multiple languages
  2. Create a notification message and configure it to show on the page and for the English language
  3. Ensure "Require all Conditions" is checked and the message is published
  4. View the home page

Expected Result

The Notification Message appears

Observed Result

No notification message appears

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pixelwhip created an issue. See original summary.

pixelwhip’s picture

Issue summary: View changes
pixelwhip’s picture

Patch attached!

  • droath committed c222ad6 on 8.x-1.x authored by pixelwhip
    Issue #3119965 by pixelwhip: Language conditions do not match contexts
    
droath’s picture

Status: Needs review » Fixed
droath’s picture

Status: Fixed » Closed (fixed)