[BUGFIX] Indexer tries to insert NULL into DB 57/26757/2
authorMarkus Klein <klein.t3@mfc-linz.at>
Sun, 12 Jan 2014 15:57:41 +0000 (16:57 +0100)
committerGeorg Ringer <georg.ringer@gmail.com>
Sun, 12 Jan 2014 16:39:09 +0000 (17:39 +0100)
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
Change-Id: Ia935abe14b9c3be2062f1b38ec98fb63921a1c2f
Reviewed-on: https://review.typo3.org/26757
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer
typo3/sysext/indexed_search/Classes/Indexer.php

index c1f9cbc..b00929b 100644 (file)
@@ -2011,10 +2011,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' => (integer)$phash,
+                                       'wid' => (integer)$val['hash'],
+                                       'count' => (integer)$val['count'],
+                                       'first' => (integer)$val['first'],
                                        'freq' => $this->freqMap($val['count'] / $this->wordcount),
                                        'flags' => $val['cmp'] & $this->flagBitMask
                                );