Environment: Liferay Portal 7.4 GA132
Portlet: Knowledge Base
Package: com.liferay.knowledge.base.web.internal.display.context
Description:
KBAdminNavigationDisplayContext.java function KBArticleServiceUtil.getKBArticles( uses a parameter KBArticleTitleComparator.getInstance(true). This means every child article below the root level are sorted by their title, not by their priority.
The order of the articles should be based on priority value of the article. You can change the priority by dragging articles up/down on in their context. The articles are also shown in priority order when viewed in the public pages.
Comparison 1: KBAdminNavigationDisplayContext.java Admin view folders and root level articles are ordered by priority comparison KBObjectsPriorityComparator.getInstance(true).
Comparison 2: KBNavigationDisplayContext.java “Knowledge Base Display” portlet left side navigation bar articles are ordered by priority comparison KBArticlePriorityComparator.getInstance(true).
The situation causes the Admin view article navigation and “Knowledge base display” public website article navigation to have different orders. Changing the order of the articles causes further problems.
How to reproduce:
- Liferay Admin → Content & Data → Knowledge base
- Create a new article “Base article”
- Create 3 articles as child articles for the “Base article”:
- CCC Article 1
- BBB Article 2
- AAA Article 3
- Refresh the admin view
Expected outcome: The order of the articles stays the same, CCC Article 1 as fist and AAA Article 3 as last.
Outcome: AAA Article 1 is show first in the admin view and CCC Article 1 as last, caused by title sorting. Articles are shown in correct order in the public view.
Possible fix: replace KBArticleTitleComparator.getInstance(true) parameter with KBObjectsPriorityComparator.getInstance(true).

