Bug #60697
closedRecursive storagePid does not work in command controller
100%
Description
I created a basic command controller which retrieves records from an Extbase repository but failed to retrieve any records. When debugging the query I noticed that the where statement checks for pid IN, which is the negative ID of the storage folder I configured in the module.tx_extension.persistence.storagePid, together with persistence.recursive = 2.
When debugging further I found that in TYPO3\CMS\Extbase\Configuration\AbstractConfigurationManager::getConfiguration() the ID is negated ($storagePid = -$storagePid). The comment above states:
// All implementations of getTreeList allow to pass the ids negative to include them into the result
// otherwise only childpages are returned
However the BackendConfigurationManager calls \TYPO3\CMS\Core\Database\QueryGenerator::getTreeList(), which does not support negative ids. Because of that the recursion will not work either because there are no pages with pid -16.
The FrontendConfigurationManager calls \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::getTreeList(), which checks for the negative ID and uses abs() to make it positive again. When I do this in the QueryGenerator getTreeList it works as expected.
In addition to this: Can anyone tell me how to configure a command controller/scheduled task to use a specific root page? I know you can set parameters from the scheduler, but the TypoScript configuration seems to be already loaded from the first found root page before the controller is executed. The only way to override this seems to be by using an URL parameter id, but I'm not sure how to do this with a command controller running from the scheduler.
Updated by Gerrit Code Review over 10 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/31919
Updated by Gerrit Code Review over 10 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/31919
Updated by Gerrit Code Review about 10 years ago
Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/32331
Updated by Anonymous about 10 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset f1089a80b6e2faf9b1eb56d5a1703135f6c7d446.