Account for dynamic theme switching in ComponentNegotiator

Created on 29 May 2023, over 1 year ago

Problem/Motivation

If the theme is switched dynamically / programmatically, the original theme is still used for attempting to find the correct component in ComponentNegotiator.

Steps to reproduce

We ran into this while using cl_components with Mercury Editor. Mercury Editor switches to the front-end theme to build Ajax responses. ComponentNegotiator was unable to correctly negotiate the component twig template because its "activeTheme" property was set to the (now incorrect) theme used when the ComponentNegotiator service was first initialized.

Proposed resolution

Dynamically check for the current active theme, rather than using a static property (activeTheme) only set once on the service.

Remaining tasks

Submit a patch / merge request.

User interface changes

None.

API changes

None.

Data model changes

None.

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States justin2pin

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

Comments & Activities

  • Issue created by @justin2pin
  • @justin2pin opened merge request.
Production build 0.71.5 2024