Commit 6e0802bb authored by Rafal Lukawiecki's avatar Rafal Lukawiecki Committed by Florent Torregrosa
Browse files

Issue #3190742 by Rafal Lukawiecki: Trying to access array offset on value of...

Issue #3190742 by Rafal Lukawiecki: Trying to access array offset on value of type null in matomo_preprocess_search_results
parent 42337f7f
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -476,7 +476,8 @@ function matomo_preprocess_search_results(&$variables) {
  // found. But the pager item mumber can tell the number of search results.
  global $pager_total_items;

  drupal_add_js('window.matomo_search_results = ' . intval($pager_total_items[0]) . ';', array('type' => 'inline', 'group' => JS_LIBRARY-1));
  $result_count = isset($pager_total_items) ? intval($pager_total_items[0]) : 0;
  drupal_add_js('window.matomo_search_results = ' . $result_count . ';', array('type' => 'inline', 'group' => JS_LIBRARY-1));
}

/**