What is wrong with my call to $ this-> redirect (...) in this code?

I have two extensions, I want to redirect from one to another in a specific action. This is my redirection code in the saveAction file of my bpsmessagcontroller of my bpsmessagecentre extension:

 $this->redirect('list', 'Coupon', 'Bpscoupons', array('message' => 'Look Ma, no syntax errors!' ));

When it starts, it simply redirects back to the list page of the calling extension (bpsmessagecenter), it does not find the Bpscoupons extension at all.

When I try to use the same code with redirects instead of redirecting, I get 500 error.

The "list" action is accessible and works from a link on the site and from some other redirects inside the bpscoupons extension.

Why won't this redirected work? Is there anything about internal or external redirects that I need to configure somewhere?

I am using typo3 4.5.32. Thanks

PS, btw in my query string, I see that I get these parameters:

tx_bpscoupons_bpsmessagecentre[message]:Hi ma... etc
tx_bpscoupons_bpsmessagecentre[action]:list
tx_bpscoupons_bpsmessagecentre[controller]:Coupon 

It seems to me that it is looking for a bpsmessagecentre object as a bpscoupons object, but I don't know.

+3
source share
1 answer

Are these 2 plugins on the same page? If this is not the case, you also need to pass the PageId page of the landing page, since $ this-> redirect in the extbase conroller takes the following arguments:

/**
 * Redirects the request to another action and / or controller.
 *
 * @param string $actionName Name of the action to forward to
 * @param string $controllerName Unqualified object name of the controller to forward to. If not specified, the current controller is used.
 * @param string $extensionName Name of the extension containing the controller to forward to. If not specified, the current extension is assumed.
 * @param array $arguments Arguments to pass to the target action
 * @param integer $pageUid Target page uid. If NULL, the current page uid is used
 * @param integer $delay (optional) The delay in seconds. Default is no delay.
 * @param integer $statusCode (optional) The HTTP status code for the redirect. Default is "303 See Other"
 */    
protected function redirect(
        $actionName,
        $controllerName = NULL,
        $extensionName = NULL,
        array $arguments = NULL,
        $pageUid = NULL, 
        $delay = 0, 
        $statusCode = 303
    )

And I think the extension name should start with a lowercase letter.

+3
source

All Articles