Apologies, but I am still struggling with this. I have deployed your
code as is, with the following changes:
I have removed this line:
if (isset($this->params[CAKE_ADMIN]) && !$this->RequestHandler->isAjax
()) {
$this->layout = 'admin';
}
...because it errors and is not relevant to me.
Same with this line:
if ($this->javascripts) {
$this->set('javascripts', $this->javascripts);
}
I am not using admin routing, so have changed references to
admin_delete to delete.
This line errors:
$this->Security->__generateToken($this);
...but works if I change the double underscore to a single underscore.
I have created the _generic folder and put the confirm_action view in
it.
I *think* I understand what is going on in the code. It picks up that
I am calling the delete action via a link (and therefore a GET). As
'delete' is in the $postActions array, I am directed to the
_confirmAction function. This renders the confirm_action view, which
contains a form that calls the delete action via a POST. When I submit
the form it ought to come back into app_controller and pass through to
the delete action. However, I am still being directed back to the
confirm_action view.
Stumped. I notice that it is calling Security->_generateToken. Should
this be being picked up anywhere else? If not, what is its purpose?
I appreciate your help. This is gnawing away at me and I can't work it
through.
Thanks.
On Nov 25, 12:48 pm, AD7six <andydawso...@gmail.com> wrote:
> On 25 nov, 13:39, jburns <jeremybu...@me.com> wrote:
>
> > This is failing before thedeletehappens. I just can't track down
> > where thedeleteis failing, when the direct is happening and why it
> > is trying to direct to adeleteview. As far as I know you never have
> > adeleteview - the model function does its job and then redirects you
> > to the view you prescribe in your controller. Just stumped really.
>
> I'm confused why after asking "I want to ask the user toconfirmthat
> he wants todelete
> a record" you're confused that the solution you're following looks for
> a view - the view for the confirmation message & form to present the
> user.
>
> I can guess you've copied and pasted the code from the article I
> linked to without understanding what it does - it prevents yourdelete
> function from running on a get request - by making use of the security
> component's blackhole to prompt the user with a form toconfirm
> whatever function it is they asked for is really what they want to do.
>
> If the error message is exactly as you typed -deleteyour
> minimalistic app-overriden missing view error, refresh the page and
> look for the text "Confirmyou have created...."http://code.cakephp.org/source/branches/1.3/cake/libs/view/errors/mis...
>
> - The error message tells you /exactly/ where cake is looking for the
> view file you directly or indirectly asked to render - and by some
> nifty Ctrl+F action in your controller(s) you can find out where in
> the code it's triggering that.
>
> hth,
>
> AD
Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
No comments:
Post a Comment