Friday, December 25, 2009

Re: Controller::redirect() issue

I've been receiving some personal comments about this issue to this day. Just
wanted to point out the solution I've been told (I haven't got around
actually testing it).

Dan wrote me this:

Dan wrote:
>
> When you define a new component, it should extend Object:
>
> class MyComponent extends Object {
>
> I suspect the problem above is because you're accidentally extending
> Component:
>
> class MyComponent extends Component { <-- wrong
>
> Easy to do :)
>

Affinity sent me this:

Affinity wrote:
>
> I had this issue... weird because I have used redirects before on
> other Cake apps, but its just failing my new one... anyway, your fix
> fixed it for me.
>
> You dont have to change any core, just copy the redirect function from
> the core file to your app_controller, then change it. Your app will
> override the core function with this one.
>


and Dan this:

Dan wrote:
>
> FYI,
>
> Just ran into this week...
>
> I found the solution to my problem in the 1.2 Manual....
>
> 3.6.3 Creating Components
> ...
> Take notice that our MathComponent extends Object and not Component.
> Extending Component can create infinite redirect issues, when combined
> with other Components.
>
> One of my components was extending the component class and not the
> object class.
>
> Thought I pass that info along in case you never resolved it.
>

I obviously want to thank these guys for helping me. As for my problem,
since my proposed solution fixed it for me I didn't spend any more time on
this. However, I just have two components in my site: one already extends
from Object and the other one extends from Component. It's the
PhpThumbComponent from the 7th comment of this page:
http://bakery.cakephp.org/articles/view/phpthumb-component. I'm not sure,
but maybe my problem was in fact caused by that component extending
Component.

--
View this message in context: http://old.nabble.com/Controller%3A%3Aredirect%28%29-issue-tp18393857p26924346.html
Sent from the CakePHP mailing list archive at Nabble.com.

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: