You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2016-02-23 13:45:23

bonpie
Member
From: Italy
Registered: 2015-04-13
Posts: 17

search items on Knowledge Base doesn't work.

Hi All,
I use GLPI 0.90.1 on Operating system: Linux debian 3.16.0.
We've recorded many Knoledge base items, but the search functions doesn't work, particulary doesn't return anything !

I've checked sql-errors.log and I've look at an error (this) :
  Error: Unknown column 'glpi_knowbaseitemtranslations.name' in 'where clause'

The complete Query is this :

2016-02-23 10:26:56 [7@debian]
  *** MySQL query error:
  SQL: SELECT COUNT(`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`)
                             WHERE (`glpi_knowbaseitems_users`.`users_id` = \'7\'  OR `glpi_knowbaseitems_users`.`users_id` = \'7\'  OR (`glpi_groups_knowbaseitems`.`groups_id`
                                    IN (\'1\')
                               AND (`glpi_groups_knowbaseitems`.`entities_id` < 0
                                    OR (  1 ) ))  OR (`glpi_knowbaseitems_profiles`.`profiles_id`
                                    = \'4\'
                               AND (`glpi_knowbaseitems_profiles`.`entities_id` < 0
                                    OR (  1 ) )) OR ( `glpi_entities_knowbaseitems`.`entities_id` IN (\'0\')  ) )  AND MATCH(`glpi_knowbaseitems`.`name`,
                                             `glpi_knowbaseitems`.`answer` ,`glpi_knowbaseitemtranslations`.`name`,
                                 `glpi_knowbaseitemtranslations`.`answer`)
                          AGAINST(\'ateco\' IN BOOLEAN MODE)  AND (`glpi_knowbaseitems`.`begin_date` IS NULL
                                   OR `glpi_knowbaseitems`.`begin_date` < NOW())
                             AND (`glpi_knowbaseitems`.`end_date` IS NULL
                                  OR `glpi_knowbaseitems`.`end_date` > NOW())
  Error: Unknown column 'glpi_knowbaseitemtranslations.name' in 'where clause'
  Backtrace :
  inc/knowbaseitem.class.php:1120
  inc/knowbaseitem.class.php:1228                    KnowbaseItem::getListRequest()
  inc/knowbase.class.php:138                         KnowbaseItem::showList()
  inc/knowbase.class.php:87                          Knowbase::showSearchView()
  inc/commonglpi.class.php:469                       Knowbase::displayTabContentForItem()
  ajax/common.tabs.php:91                            CommonGLPI::displayStandardTab()

Could you help me to understand ?
As is the KB Managemente is unusable !

Thanks in advance
Pietro

Offline

#2 2016-02-26 11:47:15

yllen
GLPI-DEV
From: Sillery (51)
Registered: 2008-01-14
Posts: 15,273

Re: search items on Knowledge Base doesn't work.

This problem is solved in 0.90.2svn


CentOS 6.5 - CentOS 7.x
PHP 5.6 - PHP 7.x - MySQL 5.6  - MariaDB 10.2 + APC + oOPcache
GLPI from 0.72 to dev version
Certifiée ITIL (ITV2F, ITILF, ITILOSA)

Offline

#3 2016-02-26 12:12:56

bonpie
Member
From: Italy
Registered: 2015-04-13
Posts: 17

Re: search items on Knowledge Base doesn't work.

Thanks very much, yllen.
But is this a kind of patch ? Is the download available ?

Many thanks !
Pietro

Offline

#4 2016-02-26 14:06:57

yllen
GLPI-DEV
From: Sillery (51)
Registered: 2008-01-14
Posts: 15,273

Re: search items on Knowledge Base doesn't work.


CentOS 6.5 - CentOS 7.x
PHP 5.6 - PHP 7.x - MySQL 5.6  - MariaDB 10.2 + APC + oOPcache
GLPI from 0.72 to dev version
Certifiée ITIL (ITV2F, ITILF, ITILOSA)

Offline

#5 2016-02-26 15:50:36

bonpie
Member
From: Italy
Registered: 2015-04-13
Posts: 17

Re: search items on Knowledge Base doesn't work.

Sorry Madame !
But I'm not able to find the bugfix indicated !
I've linked the link attached, but nothing ! (https://github.com/glpi-project/glpi/co … 0/bugfixes)

Could you exsplane me better how find it ?

Many many many thanks ! smile
Pietro

Offline

#6 2016-03-02 13:20:20

bonpie
Member
From: Italy
Registered: 2015-04-13
Posts: 17

Re: search items on Knowledge Base doesn't work.

Hi Yllen,
any help about my previous post ?

Could you explain me better how find the right link ?

Thanks in advance !
Pietro

Offline

#7 2016-03-17 16:22:22

bonpie
Member
From: Italy
Registered: 2015-04-13
Posts: 17

Re: search items on Knowledge Base doesn't work.

someone could help me to understand the solution indicated by Yllen?
I have trouble understanding!
Many thanks in advance
Pietro

Offline

#8 2016-03-18 17:42:25

yllen
GLPI-DEV
From: Sillery (51)
Registered: 2008-01-14
Posts: 15,273

Re: search items on Knowledge Base doesn't work.

Look at your database for glpi_knowbaseitemtranslations
Have you field name?


CentOS 6.5 - CentOS 7.x
PHP 5.6 - PHP 7.x - MySQL 5.6  - MariaDB 10.2 + APC + oOPcache
GLPI from 0.72 to dev version
Certifiée ITIL (ITV2F, ITILF, ITILOSA)

Offline

#9 2016-03-18 18:05:57

bonpie
Member
From: Italy
Registered: 2015-04-13
Posts: 17

Re: search items on Knowledge Base doesn't work.

-- phpMyAdmin SQL Dump
-- version 4.2.12deb2+deb8u1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Mar 18, 2016 at 05:02 PM
-- Server version: 5.5.46-0+deb8u1
-- PHP Version: 5.6.14-0+deb8u1

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- Database: `glpi`
--

-- --------------------------------------------------------

--
-- Table structure for table `glpi_knowbaseitemtranslations`
--

CREATE TABLE IF NOT EXISTS `glpi_knowbaseitemtranslations` (
`id` int(11) NOT NULL,
  `knowbaseitems_id` int(11) NOT NULL DEFAULT '0',
  `language` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
  `name` text COLLATE utf8_unicode_ci,
  `answer` longtext COLLATE utf8_unicode_ci
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `glpi_knowbaseitemtranslations`
--
ALTER TABLE `glpi_knowbaseitemtranslations`
 ADD PRIMARY KEY (`id`), ADD KEY `item` (`knowbaseitems_id`,`language`), ADD FULLTEXT KEY `fulltext` (`name`,`answer`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `glpi_knowbaseitemtranslations`
--
ALTER TABLE `glpi_knowbaseitemtranslations`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

Offline

#10 2016-03-18 18:08:00

bonpie
Member
From: Italy
Registered: 2015-04-13
Posts: 17

Re: search items on Knowledge Base doesn't work.

yllen,
Please, let me known if it's sufficient !

Thanks in advance
Pietro

Offline

#11 2016-03-18 18:46:39

yllen
GLPI-DEV
From: Sillery (51)
Registered: 2008-01-14
Posts: 15,273

Re: search items on Knowledge Base doesn't work.

You don't have to create this table.
If you don't have it you must had a problem during your migration and you perhaps have other fields missing


CentOS 6.5 - CentOS 7.x
PHP 5.6 - PHP 7.x - MySQL 5.6  - MariaDB 10.2 + APC + oOPcache
GLPI from 0.72 to dev version
Certifiée ITIL (ITV2F, ITILF, ITILOSA)

Offline

#12 2016-03-18 18:54:23

bonpie
Member
From: Italy
Registered: 2015-04-13
Posts: 17

Re: search items on Knowledge Base doesn't work.

I've got the field in question...

  `name` text COLLATE utf8_unicode_ci, 

If you check the structure for table `glpi_knowbaseitemtranslations`you can see...these  !

Where's the problem ?

Offline

#13 2016-03-29 16:55:49

bonpie
Member
From: Italy
Registered: 2015-04-13
Posts: 17

Re: search items on Knowledge Base doesn't work.

Hi yllen,
coul you reply at my previous question ? Thanks very very much in advance. smile

Pietro.

Offline

#14 2017-05-18 10:42:15

bonpie
Member
From: Italy
Registered: 2015-04-13
Posts: 17

Re: search items on Knowledge Base doesn't work.

Hi All,
I've installed a new instance, on GLPI 9.1.2 , unfortunately the knowledge-base search function does not work yet!

Could you help me ?
is there a fixing to apply? Thanks to everyone in advance.

Ciao
Pietro

Offline

#15 2017-05-22 17:13:28

yllen
GLPI-DEV
From: Sillery (51)
Registered: 2008-01-14
Posts: 15,273

Re: search items on Knowledge Base doesn't work.

Look in your database if you haven't crashed tables.
Do you have article of knowbase translated in another language?


CentOS 6.5 - CentOS 7.x
PHP 5.6 - PHP 7.x - MySQL 5.6  - MariaDB 10.2 + APC + oOPcache
GLPI from 0.72 to dev version
Certifiée ITIL (ITV2F, ITILF, ITILOSA)

Offline

#16 2023-02-01 15:02:36

henryzwh
Member
Registered: 2023-02-01
Posts: 8

Re: search items on Knowledge Base doesn't work.

I'm using GLPI 10.0.6 and wrote two Knowlewdge Base articles. The search doesn't find them. They are in the FAQ and have Targets Admin and Super-Admin (I'm logged in as Admin).
MariaDB database is intact (no crashed tables).

What am I doing wrong?

Last edited by henryzwh (2023-02-01 15:02:58)

Offline

#17 2023-02-01 15:15:32

Sico31
Member
Registered: 2018-09-24
Posts: 595

Re: search items on Knowledge Base doesn't work.

Nothing, I had the same problem since last glpu update
I open a ticket support today and have a patch to apply on glpi 10.0.6, ans o, it's works

don't forget to save the KnowbaseItem.php file before update or try it on a test platform

diff --git a/src/KnowbaseItem.php b/src/KnowbaseItem.php
index 5d4ac087db6..2e3e7f70bb5 100644
--- a/src/KnowbaseItem.php
+++ b/src/KnowbaseItem.php
@@ -1538,7 +1538,7 @@ public static function getListRequest(array $params, $type = 'search')
         ];
         if ($params['knowbaseitemcategories_id'] > 0) {
             $criteria['WHERE'][KnowbaseItem_KnowbaseItemCategory::getTableField('knowbaseitemcategories_id')] = $params['knowbaseitemcategories_id'];
-        } else {
+        } elseif ($params['knowbaseitemcategories_id'] === 0) {
             $criteria['WHERE'][KnowbaseItem_KnowbaseItemCategory::getTableField('knowbaseitemcategories_id')] = null;
         }

@@ -1582,6 +1582,10 @@ public static function getListRequest(array $params, $type = 'search')
                 $criteria['WHERE']['glpi_knowbaseitems_users.users_id'] = null;
                 break;

+            case 'allpublished':
+                $criteria['HAVING']['visibility_count'] = ['>', 0];
+                break;
+
             case 'search':
                 if (strlen($params["contains"]) > 0) {
                     $search  = Sanitizer::unsanitize($params["contains"]);
@@ -1759,7 +1763,7 @@ public static function showList($options, $type = 'search')
        // Default values of parameters
         $params['faq']                       = !Session::haveRight(self::$rightname, READ);
         $params["start"]                     = "0";
-        $params["knowbaseitemcategories_id"] = "0";
+        $params["knowbaseitemcategories_id"] = null;
         $params["contains"]                  = "";
         $params["target"]                    = $_SERVER['PHP_SELF'];


Manger un castor, c'est sauver un arbre.
Quand on est mort, on ne sait pas qu'on est mort ; c'est pour les autres que c'est difficile. Quand on est con, c'est pareil !

Offline

#18 2023-02-01 15:56:05

henryzwh
Member
Registered: 2023-02-01
Posts: 8

Re: search items on Knowledge Base doesn't work.

Thank you, I found the issue 13912 at Github. Search is working now.

Offline

Board footer

Powered by FluxBB