Skip to content

"An unexpected error occurred" when searching by tag in Knowledge Base Tree view #344

@masakazuwatanabe

Description

@masakazuwatanabe

Code of Conduct

  • I agree to follow this project's Code of Conduct

Is there an existing issue for this?

  • I have searched the existing issues

GLPI Version

11.0.6 (also 11.0.7, earlier versions unknown)

Plugin version

2.14.3

Bug description

Image Image
  • When searching by tag while the Knowledge Base Browse view is set to Tree view, the error message "An unexpected error occurred" is displayed.
  • After this happens, the Knowledge Base cannot be accessed anymore because the search condition seems to remain in the session.
  • The issue persists until the user logs out.

Relevant log output

[2026-05-01 19:18:16] glpi.CRITICAL:   *** Uncaught PHP Exception RuntimeException: "MySQL query error: Unknown column 'ITEM_KnowbaseItem_10500' in 'HAVING' (1054) in SQL query "SELECT `glpi_knowbaseitemcategories`.`id`, `glpi_knowbaseitemcategories`.`name`, `glpi_knowbaseitemcategories`.`knowbaseitemcategories_id`, (SELECT COUNT(DISTINCT(`glpi_knowbaseitems`.`id`)) AS `cpt` FROM `glpi_knowbaseitems` LEFT JOIN `glpi_knowbaseitems_knowbaseitemcategories` ON (`glpi_knowbaseitems_knowbaseitemcategories`.`knowbaseitems_id` = `glpi_knowbaseitems`.`id` AND (true)) WHERE `glpi_knowbaseitems_knowbaseitemcategories`.`knowbaseitemcategories_id` = `glpi_knowbaseitemcategories`.`id` AND glpi_knowbaseitems.id IN ( SELECT * FROM (SELECT DISTINCT glpi_knowbaseitems.id FROM `glpi_knowbaseitems`LEFT JOIN `glpi_knowbaseitems_users` ON (`glpi_knowbaseitems_users`.`knowbaseitems_id` = `glpi_knowbaseitems`.`id`) LEFT JOIN `glpi_groups_knowbaseitems` ON (`glpi_groups_knowbaseitems`.`knowbaseitems_id` = `glpi_knowbaseitems`.`id`) LEFT JOIN `glpi_knowbaseitems_profiles` ON (`glpi_knowbaseitems_profiles`.`knowbaseitems_id` = `glpi_knowbaseitems`.`id`) LEFT JOIN `glpi_entities_knowbaseitems` ON (`glpi_entities_knowbaseitems`.`knowbaseitems_id` = `glpi_knowbaseitems`.`id`) LEFT JOIN `glpi_plugin_tag_tagitems` AS `glpi_plugin_tag_tagitems_7f845d8489f64272eeb637af9156eae4` ON (`glpi_knowbaseitems`.`id` = `glpi_plugin_tag_tagitems_7f845d8489f64272eeb637af9156eae4`.`items_id` AND `glpi_plugin_tag_tagitems_7f845d8489f64272eeb637af9156eae4`.`itemtype` = 'KnowbaseItem') LEFT JOIN `glpi_plugin_tag_tags` AS `glpi_plugin_tag_tags_23e0c5a3c33f9fc3341d81fc24a0e3a5` ON (`glpi_plugin_tag_tagitems_7f845d8489f64272eeb637af9156eae4`.`plugin_tag_tags_id` = `glpi_plugin_tag_tags_23e0c5a3c33f9fc3341d81fc24a0e3a5`.`id`) LEFT JOIN `glpi_knowbaseitems_items` ON (`glpi_knowbaseitems`.`id` = `glpi_knowbaseitems_items`.`knowbaseitems_id`) WHERE 1 HAVING (`ITEM_KnowbaseItem_10500` LIKE '%2%' )) AS id_criteria )) AS `items_count` FROM `glpi_knowbaseitemcategories` ORDER BY `glpi_knowbaseitemcategories`.`level` DESC, `glpi_knowbaseitemcategories`.`name`"." at DBmysql.php line 416
  Backtrace :
  ./src/DBmysql.php:416                              
  ./src/DBmysqlIterator.php:129                      DBmysql->doQuery()
  ./src/DBmysql.php:1088                             DBmysqlIterator->execute()
  ./src/Glpi/Features/TreeBrowse.php:265             DBmysql->request()
  ./src/Glpi/Features/TreeBrowse.php:85              KnowbaseItem::getTreeCategoryList()
  ./ajax/search.php:74                               KnowbaseItem::showBrowseView()
  ...Glpi/Controller/LegacyFileLoadController.php:64 require()
  ./vendor/symfony/http-kernel/HttpKernel.php:181    Glpi\Controller\LegacyFileLoadController->__invoke()
  ./vendor/symfony/http-kernel/HttpKernel.php:76     Symfony\Component\HttpKernel\HttpKernel->handleRaw()
  ./vendor/symfony/http-kernel/Kernel.php:208        Symfony\Component\HttpKernel\HttpKernel->handle()
  ./public/index.php:71                              Symfony\Component\HttpKernel\Kernel->handle()

Page URL

/front/knowbaseitem.php

Steps To reproduce

No response

Your GLPI setup information

  • The issue occurs during normal operation, as described in the bug description.
  • This behavior also occurs on a clean installation.

Anything else?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions