I call it once but works with only the action params.
$this->redirect( array( "action" => "index" ) );



Il 08/03/2012 22:15, Miles J ha scritto:
Is there a reason why you are calling redirect() twice?

On Thursday, March 8, 2012 8:08:39 AM UTC-8, muka wrote:

    Hi,
    I got a strange behaviour ajax-sending a form.
    In controller the record is saved correctly but I get a 404
    response withᅵ "Missing Controller, Error: Controller could not
    be found."

    This happens calling:
    - $this->redirect( $this->referer() );
    - $this->redirect( array( "controller" => "apples", "action" =>
    "index" ) );
    but works with:
    - $this->redirect( array( "action" => "index" ) );

    Following the stack trace I found that the $request passed to
    Dispatcher->dispatch() contains empty values, causing probably the
    error.
    May be a bug somewhere in the process of rendering the ajax response?

    Thanks in advance,
    Luca

    Stack Trace:

      * CORE/Cake/Core/Object.php line 102 →
        Dispatcher->dispatch(CakeRequest, CakeResponse, array)
      * CORE/Cake/Controller/Component/RequestHandlerComponent.php
        line 243 → Object->requestAction(string, array)
      * [internal function] →
        RequestHandlerComponent->beforeRedirect(ApplesController,
        string, null, boolean)
      * CORE/Cake/Utility/ObjectCollection.php line 130 →
        call_user_func_array(array, array)
      * [internal function] → ObjectCollection->trigger(CakeEvent)
      * CORE/Cake/Event/CakeEventManager.php line 245 →
        call_user_func(array, CakeEvent)
      * CORE/Cake/Controller/Controller.php line 737 →
        CakeEventManager->dispatch(CakeEvent)
      * APP/Controller/ContractsController.php line 129 →
        Controller->redirect(string)
      * [internal function] → ContractsController->edit(string)
      * CORE/Cake/Controller/Controller.php line 484 →
        ReflectionMethod->invokeArgs(ContractsController, array)
      * CORE/Cake/Routing/Dispatcher.php line 104 →
        Controller->invokeAction(CakeRequest)
      * CORE/Cake/Routing/Dispatcher.php line 86 →
        Dispatcher->_invoke(ContractsController, CakeRequest,
        CakeResponse)
      * APP/webroot/index.php line 97 →
        Dispatcher->dispatch(CakeRequest, CakeResponse)

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at http://groups.google.com/group/cake-php

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to