Bug #75542
closedNew Content element wizard ignores current page uid
0%
Description
Hey,
I think there is a bug in the "New Content element wizard".
I have a content element with an own wizard which uses the TypoScript configuration from \TYPO3\CMS\Extbase\Configuration\ConfigurationManager->getConfiguration(...).
This needs the correct page uid (pid) because we have different configurations in a website system with multiple "root sites".
The backend configuration manager uses the function \TYPO3\CMS\Extbase\Configuration\BackendConfigurationManager->getCurrentPageId() to get this id.
This function checks the GP vars and uses a "random" root page if no "id" was submitted via GP vars.
--> So we should send a GP var "id" in the "New Content element wizard".
This should be done in \TYPO3\CMS\Backend\Tree\View\ContentCreationPagePositionMap->onClickInsertRecord(...).
We can just add the paramter "id" and everything works fine:
$location = \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('record_edit', array( ... 'id' => $pid, ... ));
What do you think about it?
Markus
Updated by Gerrit Code Review over 8 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 https://review.typo3.org/47625
Updated by Christian Kuhn over 8 years ago
Hey.
I don't understand your scenario: The link generated is used to jump to "EditDocumentController" / FormEngine. The pid is hand over as parameter as 'edit[tt_content][ "row of element (indirect pid), or pid directly ] => new.
What exactly do you mean with "i have my own wizard". Do you talk of a FormEngine wizard that is later rendered via "renderWizards()" in FormEngine? And there you miss the pid, so you want to add it as parameter in the new content element wizard?
Background:
The uid, table, pid handling is prepared and resolved in the data providers and FormEngine render code finds that later in the main array that is hand over. So that should be the starting point. Just adding a parameter in get/post, so your wizard is later able to _GP('id') on that is not a good solution.
Could you clear up your scenario a bit?
If I'm on the totally wrong track, please add screenshots or similar as additional explanation.
Updated by Christian Kuhn over 8 years ago
- Status changed from Under Review to Needs Feedback
Updated by Markus Hölzle over 8 years ago
Hey,
I have a TCA field of the type 'user', which renders some special stuff.
For this stuff I need the TypoScript configuration (for the current page) which will be loaded from the "BackendConfigurationManager".
This BackendConfigurationManager gets the current page id from the _GP('id') (see \TYPO3\CMS\Extbase\Configuration\BackendConfigurationManager::getCurrentPageIdFromGetPostData()) which is not set.
Maybe this ConfigurationManager should also respect the "edit[tt_content][" parameter? But isn't that a bit inconsistent?
Updated by Nicole Cordes over 8 years ago
You should not use TypoScript in backend context! TypoScript is for frontend. In backend you should use TSConfig (UserTS, PageTS). This is already compiled for user types and available over $parentObject->data['pageTsConfig'] or $parentObject->data['userTsConfig'].
If you really need TypoScript in your case, you can set the correct id by yourself. But this isn't recommended and not supported by the core!
Updated by Nicole Cordes over 8 years ago
- Status changed from Needs Feedback to Closed