[FEATURE] Enable queries using "root" and "-1" for pidInList 23/28623/5
authorOliver Hader <oliver@typo3.org>
Fri, 21 Mar 2014 22:13:57 +0000 (23:13 +0100)
committerOliver Hader <oliver.hader@typo3.org>
Sat, 22 Mar 2014 00:44:32 +0000 (01:44 +0100)
commit20acc4019a14c97431400a4c13b7762c1bbcecc2
treea5c7ededa5de38891115832e7310bbf02836d818
parentcf6413044b496f2a06171dc096dd4484e98715c9
[FEATURE] Enable queries using "root" and "-1" for pidInList

The version preview in the frontend rendering process basically
selects only the live versions and then overlays those records
with possible versions. Since the MM handling is changed to
directly point to the most specific version in that regard (this
is an exception to the "always live, overlay then" approach), the
versions also need to be selected directly. ContentObjectRenderer
uses the method PageRepository::enableFields() which adds an
additional SQL WHERE part, like " AND tablename.pid<>-1" to
exclude possible versions.

Besides that, elements (like sys_catagory) that are stored on the
root-level cannot be queried at all which leads to custom code in
the end just to perform these queries.

This change allows selections on the root-level and disables the
"pid<>-1" constraint if the opposite has been defined in the
pidInList property.

Example:
select.pidInList = root,-1

Resolves: #57168
Documentation: #57171
Releases: 6.2
Change-Id: I6fb91f89f70614d59c83d808f07e890833248880
Reviewed-on: https://review.typo3.org/28623
Reviewed-by: Ernesto Baschny
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.ts
typo3/sysext/core/Tests/Functional/Framework/Frontend/UserFunction.php [deleted file]
typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
typo3/sysext/frontend/Classes/Page/PageRepository.php
typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTest.php