[BUGFIX] Live search shows move placeholders in draft workspace 25/44925/2
authorAlexander Opitz <opitz@pluspol.info>
Tue, 24 Nov 2015 09:28:55 +0000 (10:28 +0100)
committerJigal van Hemert <jigal.van.hemert@typo3.org>
Sun, 6 Dec 2015 12:15:12 +0000 (13:15 +0100)
This patch makes sure that all records that have a t3ver_move_id
other than 0 are ignored.

Resolves: #37896
Releases: master, 6.2
Change-Id: Id0b45ebdc72522f46bc9b51261eeca2e01d48db9
Reviewed-on: https://review.typo3.org/44925
Reviewed-by: Michael Oehlhof <typo3@oehlhof.de>
Tested-by: Michael Oehlhof <typo3@oehlhof.de>
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Jigal van Hemert <jigal.van.hemert@typo3.org>
Tested-by: Jigal van Hemert <jigal.van.hemert@typo3.org>
typo3/sysext/backend/Classes/Search/LiveSearch/LiveSearch.php

index a9ed1dc..06f1eaa 100644 (file)
@@ -332,6 +332,7 @@ class LiveSearch {
                        // And the relevant conditions for deleted and versioned records
                        $queryPart .= BackendUtility::deleteClause($tableName);
                        $queryPart .= BackendUtility::versioningPlaceholderClause($tableName);
+                       $queryPart .= BackendUtility::getWorkspaceWhereClause($tableName);
                } else {
                        $queryPart = ' AND 0 = 1';
                }
@@ -440,6 +441,8 @@ class LiveSearch {
                        $tree->getTree($id, $depth, '');
                }
                $tree->ids[] = $id;
+               // add workspace pid - workspace permissions are taken into account by where clause later
+               $tree->ids[] = -1;
                $idList = implode(',', $tree->ids);
                return $idList;
        }