Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Steur <tsteur@users.noreply.github.com>2021-10-14 02:19:10 +0300
committerGitHub <noreply@github.com>2021-10-14 02:19:10 +0300
commitb3c276e03a3e79af7d125e6a93bb6d84b4b59eed (patch)
tree259effef300c04f931eb180f91b3ad3c1346ebc5 /plugins/CoreHome
parent99cf09920c4b9b275c9fc68e6f08af10a886fb49 (diff)
Fix error cannot read property "replace" of undefined in quick search (#18149)
* Fix error cannot read property "replace" of undefined in quick search * Update quick-access.directive.js
Diffstat (limited to 'plugins/CoreHome')
-rw-r--r--plugins/CoreHome/angularjs/quick-access/quick-access.directive.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/plugins/CoreHome/angularjs/quick-access/quick-access.directive.js b/plugins/CoreHome/angularjs/quick-access/quick-access.directive.js
index 21f678f161..7417261c8e 100644
--- a/plugins/CoreHome/angularjs/quick-access/quick-access.directive.js
+++ b/plugins/CoreHome/angularjs/quick-access/quick-access.directive.js
@@ -58,9 +58,12 @@
}
scope.quickAccessTitle = translate('CoreHome_QuickAccessTitle', searchAreasTitle);
-
+
function trim(str) {
- return str.replace(/^\s+|\s+$/g,'');
+ if (str) {
+ return str.replace(/^\s+|\s+$/g,'');
+ }
+ return str;
}
scope.getTopMenuItems = function()
@@ -107,7 +110,6 @@
$element.find('li .item').each(function (i, element) {
var $element = angular.element(element);
var text = trim($element.text());
-
if (text) {
leftMenuItems.push({name: text, category: category, index: ++menuIndex});
$element.attr('quick_access', menuIndex);