[BUGFIX] Indexer tries to insert NULL into DB 44/30244/2
authorMarkus Klein <klein.t3@mfc-linz.at>
Sun, 12 Jan 2014 15:57:41 +0000 (16:57 +0100)
committerOliver Hader <oliver.hader@typo3.org>
Wed, 21 May 2014 10:26:14 +0000 (12:26 +0200)
The Indexer of indexed_search tries to insert NULL values
into NOT NULL columns of the database.

Since #53662 NULL values are passed to the database,
hence these insert statements now fail.

Resolves: #54917
Releases: 6.2, 6.1, 6.0
Change-Id: Ia935abe14b9c3be2062f1b38ec98fb63921a1c2f
Reviewed-on: https://review.typo3.org/30244
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
typo3/sysext/indexed_search/Classes/Indexer.php

index cd87b84..44a2b93 100644 (file)
@@ -2010,10 +2010,10 @@ class Indexer {
                        $GLOBALS['TYPO3_DB']->exec_DELETEquery('index_rel', 'phash=' . intval($phash));
                        foreach ($wordList as $val) {
                                $insertFields = array(
-                                       'phash' => $phash,
-                                       'wid' => $val['hash'],
-                                       'count' => $val['count'],
-                                       'first' => $val['first'],
+                                       'phash' => (int)$phash,
+                                       'wid' => (int)$val['hash'],
+                                       'count' => (int)$val['count'],
+                                       'first' => (int)$val['first'],
                                        'freq' => $this->freqMap($val['count'] / $this->wordcount),
                                        'flags' => $val['cmp'] & $this->flagBitMask
                                );