Project

General

Profile

Actions

Bug #75542

closed

New Content element wizard ignores current page uid

Added by Markus Hölzle over 8 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
-
Target version:
-
Start date:
2016-04-12
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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

Actions #1

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

Actions #2

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.

Actions #3

Updated by Christian Kuhn over 8 years ago

  • Status changed from Under Review to Needs Feedback
Actions #4

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?

Actions #5

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!

Actions #6

Updated by Nicole Cordes over 8 years ago

  • Status changed from Needs Feedback to Closed
Actions

Also available in: Atom PDF