diff --git a/htdocs/knowledgemanagement/class/knowledgerecord.class.php b/htdocs/knowledgemanagement/class/knowledgerecord.class.php
index 0d233f37af6..77493590d9d 100644
--- a/htdocs/knowledgemanagement/class/knowledgerecord.class.php
+++ b/htdocs/knowledgemanagement/class/knowledgerecord.class.php
@@ -728,6 +728,7 @@ class KnowledgeRecord extends CommonObject
$langs->loadLangs(['knowledgemanagement', 'languages']);
$datas = [];
+ $nofetch = empty($params['nofetch']) ? false : true;
$datas['picto'] = img_picto('', $this->picto).' '.$langs->trans("KnowledgeRecord").'';
if (isset($this->statut)) {
$datas['picto'] .= ' '.$this->getLibStatut(5);
@@ -736,8 +737,8 @@ class KnowledgeRecord extends CommonObject
$datas['question'] = '
'.$langs->trans('Question').': '.$this->question;
$labellang = ($this->lang ? $langs->trans('Language_'.$this->lang) : '');
$datas['lang'] = '
'.$langs->trans('Language').': ' . picto_from_langcode($this->lang, 'class="paddingrightonly saturatemedium opacitylow"') . $labellang;
- // show categories for this record
- if (isModEnabled('categorie')) {
+ // show categories for this record only in ajax to not overload lists
+ if (isModEnabled('categorie') && !$nofetch) {
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
$form = new Form($this->db);
$datas['categories'] = '
' . $form->showCategories($this->id, Categorie::TYPE_KNOWLEDGEMANAGEMENT, 1);
@@ -769,6 +770,8 @@ class KnowledgeRecord extends CommonObject
$params = [
'id' => $this->id,
'objecttype' => $this->element,
+ 'option' => $option,
+ 'nofetch' => 1,
];
$classfortooltip = 'classfortooltip';
$dataparams = '';