From 61af10b6ce8a27de32c0f0e36b98a686a13d7f21 Mon Sep 17 00:00:00 2001 From: Extarys Date: Wed, 20 Jan 2021 09:21:57 -0500 Subject: [PATCH] fix: undefined search tag #9789 --- view/theme/frio/js/theme.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/view/theme/frio/js/theme.js b/view/theme/frio/js/theme.js index b630739668..18ead816e1 100644 --- a/view/theme/frio/js/theme.js +++ b/view/theme/frio/js/theme.js @@ -136,7 +136,7 @@ $(document).ready(function(){ // initialize the bootstrap-select $('.selectpicker').selectpicker(); - // add search-heading to the seccond navbar + // add search-heading to the second navbar if( $(".search-heading").length) { $(".search-heading").appendTo("#topbar-second > .container > #tabmenu"); } @@ -147,6 +147,13 @@ $(document).ready(function(){ // get the text of the heading (we catch the plain text because we don't // want to have a h4 heading in the navbar var searchText = $(".section-title-wrapper > h2").html(); + + // temporary workaround to avoid 'undefined' being displayed (issue #9789) + // https://github.com/friendica/friendica/issues/9789 + // TODO: find a way to localize this string + if(typeof searchText === "undefined") { + searchText = "No results"; + } // insert the plain text in a

heading and give it a class var newText = '

'+searchText+'

'; // append the new heading to the navbar