Reputation: 331
I have a contoller that it calls SocialProfile with one action for get the profile of Twitter, Facebook or Google+ and save the SocialProfile object, each one. The end of this action calls the edit action with the objective of the end user add groups of categories (not TYPO3 category), the problem is the second action does not work correctly.
I have been using this instruction for calls editAction
at the end of createAction
$this->redirect('edit', null, null, array('profileid' => "{$profileid}"),11);
Now the editAction
public function editAction( $socialProfile = NULL)
{
$arguments = $this->request->getArguments();
var_dump($arguments);
$groups = Enum\GruposContenidos::categoryGroupList();
$this->view->assign('categoryGroups', $groups);
$this->view->assign('socialProfile', $socialProfile);
}
The error is next
Required argument "socialProfile" is not set for Vendor\Extension\Controller\SocialProfileController->edit. exception code:1298012500
I have identicated in the URL that editAction
method runs but does not show the var_dump
. I follow the error code in TYPO3 (https://wiki.typo3.org/Exception/Flow/1298012500) and I have tried many changes but does not work.
What is the correct way to call this type of actions or is it possible to use something like redirect
sending parameters?
The editAction
works well when it is called from the action list through Fluid and lets change the category values.
It is beeing develop in TYPO3 7.6 and PHP 5.6.
Upvotes: 0
Views: 1273
Reputation: 54
You can var_dump inside the initializeEditAction.
pls try:
$this->redirect('edit', null, null, array('profileid' => $profileid),11);
can you show me the annotations from the editAction and unistall and install the extension one time. Annotations and methodes arguments are hard cached. The action shoulden't fire the exception, if you allow, like you do, that the argument could be null so im afraid that extbase diden't notice that for some cache reason.
Sorry i can not comment i don't have enough reputation :(
Upvotes: 1
Reputation: 260
Have you tried $this->redirect('edit', null, null, array('socialProfile' => $socialProfile),11);
and pass the whole SocialProfile object rather than its ID? Generally, you need to match the two names.
Upvotes: 1