Uncaught TypeError: drupalSettings.matomo is undefined

Created on 28 March 2024, about 1 year ago

Problem/Motivation

Uncaught TypeError: drupalSettings.matomo is undefined

In matomo.module in function:

function matomo_page_attachments(array &$page) {

we have:
if ((_matomo_visibility_pages() || in_array($status, $trackable_status_codes)) && _matomo_visibility_user($account)) {
in that if: "trackMailto" is set.

Thus when javascript tries to check for drupalSettings.matomo.trackMailto inside of matomo.js this error gets triggered?

Steps to reproduce

Drupal 10 + Js aggregation.
When editing a block on a layout builder page > this error is triggered.

Proposed resolution

Check if the variable exists (or set it by default?)

Remaining tasks

Review

🐛 Bug report
Status

Needs review

Version

1.23

Component

Code

Created by

🇧🇪Belgium mschudders

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024