Project

General

Profile

Actions

Bug #88533

open

`persistence.classes.*.newRecordStoragePid` does not get `stdWrap` applied (other than `persistence.storagePid`)

Added by Leonie Philine almost 5 years ago. Updated 7 months ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Extbase
Start date:
2019-06-09
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
configuration typoscript
Complexity:
easy
Is Regression:
No
Sprint Focus:

Description

See \TYPO3\CMS\Extbase\Persistence\Generic\Backend::determineStoragePageIdForNewRecord():

if (isset($frameworkConfiguration['persistence']['classes'][$className]) && !empty($frameworkConfiguration['persistence']['classes'][$className]['newRecordStoragePid'])) {
    return (int)$frameworkConfiguration['persistence']['classes'][$className]['newRecordStoragePid'];
}

This makes `persistance.classes.*.newRecordStoragePid` unusable with the good practice of storing PID values in the site config.yaml as single source of truth, like that:

plugin.xyz.persistence.classes.Vendor\Ext\Domain\Model\FrontendUser {
    newRecordStoragePid.dataWrap = {site:pages.frontendUsers}
}

This approach does work with `persistence.storagePid`, because in `\TYPO3\CMS\Extbase\Configuration\AbstractConfigurationManager::getConfiguration()`, `stdWrap` is applied:

if (is_array($frameworkConfiguration['persistence']['storagePid'])) {
    // We simulate the frontend to enable the use of cObjects in
    // stdWrap. Than we convert the configuration to normal TypoScript
    // and apply the stdWrap to the storagePid
    if (!$this->environmentService->isEnvironmentInFrontendMode()) {
        \TYPO3\CMS\Extbase\Utility\FrontendSimulatorUtility::simulateFrontendEnvironment($this->getContentObject());
    }
    $conf = $this->typoScriptService->convertPlainArrayToTypoScriptArray($frameworkConfiguration['persistence']);
    $frameworkConfiguration['persistence']['storagePid'] = $GLOBALS['TSFE']->cObj->stdWrap($conf['storagePid'], $conf['storagePid.']);
    if (!$this->environmentService->isEnvironmentInFrontendMode()) {
        \TYPO3\CMS\Extbase\Utility\FrontendSimulatorUtility::resetFrontendEnvironment();
    }
}
Actions

Also available in: Atom PDF