Back button on kb_view2 does not work on Service Portal


Description

The browser Back button does not work from kb_view2 page on the Service Portal

 

Release or Environment

Madrid
New York

Cause

As of the Madrid release, we have the ability to associate more than one knowledge base to a single service portal. Along with this came the introduction of the KB Knowledge Bases [kb-knowledge-bases] widget. This widget is included in the kb_view2 page and contains logic that will first determine if there are more than one knowledge base associated with the current portal. If so, the widget will display, allowing the user to select a specific knowledge base to search. If there is only one knowledge base configured, the widget will perform a redirect automatically to the same page but with "kb_id=<sysid_of_knowledge_base>" appended to the URL. 

Resolution

The following problem is related to this behavior:
PRB1348414 Performance - While Navigating to Knowledge from service portal(/sp) - sp page api calls getting triggered twice 

This is fixed in the current Orlando release. 

The workaround for this in New York would be to modify the client controller code of the "KB Knowledge Bases" widget: 

modify the code:
 

if(c.data.kbs.length == 1) { 
var searchParms = $location.search(); 
searchParms.kb_id = c.data.kbs[0]; 
$location.search(searchParms); 
} else if(c.data.selectedIndex == 0) //Populate kb_id as null when more one than KB is associates with Portal and no KB is selected. 
$location.search('kb_id', c.data.kbId); 


to: 


if (c.data.selectedIndex == 0) //Populate kb_id as null when more one than KB is associates with Portal and no KB is selected. 
$location.search('kb_id', c.data.kbId); 

 

Please note that if you implement the code change to the New York version of the "KB Knowledge Bases" widget, the fix will be skipped when you upgrade to Orlando so you would need to manage that. 

Additional Information

A double click will bring the user back to the previous page, but a single click or more than 1 single click will not.