[BUGFIX] Prevent warning in FAL "Update storage index" scheduler task 36/37036/5
authorNicole Cordes <typo3@cordes.co>
Fri, 20 Feb 2015 08:47:24 +0000 (09:47 +0100)
committerHelmut Hummel <helmut.hummel@typo3.org>
Fri, 20 Feb 2015 13:31:50 +0000 (14:31 +0100)
Due to the use of intval within array_walk a warning is triggered,
because array_walk calls the function with two parameters where intval
only expects one. This patch replaces the array_walk function with
DatabaseConnection::cleanIntArray.

Releases: master, 6.2
Resolves: #65189
Change-Id: Ic487f2da589e1610bd9ac7ec721d48a2735ef980
Reviewed-on: http://review.typo3.org/37036
Reviewed-by: Helmut Hummel <helmut.hummel@typo3.org>
Tested-by: Helmut Hummel <helmut.hummel@typo3.org>
Reviewed-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Tested-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
typo3/sysext/core/Classes/Resource/Index/FileIndexRepository.php

index 1246c1e..f7627b8 100644 (file)
@@ -286,9 +286,7 @@ class FileIndexRepository implements SingletonInterface {
        public function findInStorageAndNotInUidList(\TYPO3\CMS\Core\Resource\ResourceStorage $storage, array $uidList) {
                $where = 'storage = ' . (int)$storage->getUid();
                if (!empty($uidList)) {
-                       array_walk($uidList, 'intval');
-                       $uidList = array_unique($uidList);
-                       $where .= ' AND uid NOT IN (' . implode(',', $uidList) . ')';
+                       $where .= ' AND uid NOT IN (' . implode(',', $this->getDatabaseConnection()->cleanIntArray($uidList)) . ')';
                }
                return $this->getDatabaseConnection()->exec_SELECTgetRows(implode(',', $this->fields), $this->table, $where);
        }