Skip to content

fix(themes): Fix JS window settings serialization using json_encode#829

Open
Ahmed-S-Abduallah wants to merge 1 commit intomasterfrom
bugfix/THEM-0000-raed-json-encode-theme-settings
Open

fix(themes): Fix JS window settings serialization using json_encode#829
Ahmed-S-Abduallah wants to merge 1 commit intomasterfrom
bugfix/THEM-0000-raed-json-encode-theme-settings

Conversation

@Ahmed-S-Abduallah
Copy link
Copy Markdown
Contributor

🐛 Fix Array-to-string conversion in theme Twig → JS injection

Summary
Fixes "Array to string conversion" errors when theme/store settings are passed into JavaScript. Any setting that can be an array (or object) was being output as a string, which caused runtime errors.

Changes

  • 📄 master.twig (all affected themes)
    Replaced direct string interpolation of theme.settings.get(...) and similar values with | json_encode | raw so values are safely serialized for JS (strings, booleans, arrays, objects).

Result

  • ✅ No more Array-to-string conversion from these settings.
  • ✅ JS receives valid JSON (strings, numbers, booleans, arrays, objects).
  • ✅ Same approach used consistently across themes.

@sallainternalbot sallainternalbot bot marked this pull request as draft February 3, 2026 20:00
@Ahmed-S-Abduallah Ahmed-S-Abduallah marked this pull request as ready for review February 3, 2026 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant