Skip to content
Snippets Groups Projects
Commit 7491f991 authored by Sven Schüring's avatar Sven Schüring
Browse files

Issue #3238489 by sunlix, design.er: Uncaught TypeError: Cannot read properties of null

parent 2228276f
No related branches found
No related tags found
1 merge request!45Decouple etracker.js from vendor library definition
Pipeline #303969 passed with warnings
......@@ -64,18 +64,17 @@ function etracker_library_info_build(): array {
|| $eventTracking['track_system_messages'];
if ($isEventTrackingEnabled) {
$libraries[$libraryName]['js'] += [
'js/etracker.js' => [
'attributes' => [
'id' => 'etracker_script',
'defer' => TRUE,
$libraries['event_tracking'] = [
'js' => [
'js/etracker.js' => [
'attributes' => [
'id' => 'etracker_script',
],
],
],
];
$libraries[$libraryName] += [
'dependencies' => [
'core/drupal',
'core/drupalSettings',
Constants::ETRACKER_FULL_LIBRARY_NAME,
],
];
}
......@@ -181,6 +180,7 @@ function etracker_page_attachments_alter(array &$attachments): void {
}
$attachments['#attached']['library'][] = Constants::ETRACKER_FULL_LIBRARY_NAME;
$attachments['#attached']['library'][] = 'etracker/event_tracking';
$attachments['#attached']['drupalSettings']['etracker'] = $script_settings;
$request = Drupal::request();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment