Re: requestAction issue when using a plugin

2007-01-31 Thread Doug

On Jan 31, 2:20 am, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote:
> Go ahead hack the CakePHP core to make it work - create a patch and
> post a ticket in the Trac with your patch attached - someone from the
> dev team will apply the patch or suggest alternatives.

Thanks for your advice.

I opened a new Trac:
https://trac.cakephp.org/ticket/2027

Basically I removed the class_exists from loadController since it does
not differentiate between a plugin controller and a regular
controller. And I changed all of the requires to require_once.

Things are working nicely locally for me now.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: requestAction issue when using a plugin

2007-01-31 Thread Dr. Tarique Sani

On 1/31/07, Doug <[EMAIL PROTECTED]> wrote:
> I downloaded the nightly build (  1.2.x.x_30.01.2007.zip ), which I
> think is the newest I can get. And it looks different from your diff.

Yes,  presume it would be different from the diff (the diff is not for
1.2) but the problem appears to be similar to what the diff solved -
and yes - your assumption about loadController returning false would
be most likely correct.

Go ahead hack the CakePHP core to make it work - create a patch and
post a ticket in the Trac with your patch attached - someone from the
dev team will apply the patch or suggest alternatives.

HTH
Tarique

-- 
=
PHP for E-Biz: http://sanisoft.com
Cheesecake-Photoblog: http://cheesecake-photoblog.org
=

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: requestAction issue when using a plugin

2007-01-31 Thread Doug

On Jan 31, 12:59 am, "Dr. Tarique Sani" <[EMAIL PROTECTED]
> There was a bug in v1.1 which prevented more than one requestAction
> calls on the same page to the same plugin and it was fixed - search
> the Trac for it, I had reported and submitted a patch - perhaps it is
> a similar issue raising its head again in v1.2

I previously read this thread:
requestAction() with plugins not working!
http://groups.google.com/group/cake-php/browse_thread/thread/71e6cacd0d154d67/b804235468ae9b26?lnk=gst&q=requestaction+plugin&rnum=2

Which leads to your Trac:
https://trac.cakephp.org/ticket/1721

And the diff:
https://trac.cakephp.org/changeset/4071

I downloaded the nightly build (  1.2.x.x_30.01.2007.zip ), which I
think is the newest I can get. And it looks different from your diff.

The problem I see is that loadController returns false if the
controller is already loaded. And the result of loadController is
still used to determine if the controller is a plugin or not (in
dispatch.php - function dispatch ).

Doug


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: requestAction issue when using a plugin

2007-01-30 Thread Dr. Tarique Sani

On 1/31/07, Doug <[EMAIL PROTECTED]> wrote:
> requestAction("Menu/display/main_menu",
> array( "return"=>true ) ); ?>
> requestAction("Menu/display/main_menu",
> array( "return"=>true ) ); ?>

There was a bug in v1.1 which prevented more than one requestAction
calls on the same page to the same plugin and it was fixed - search
the Trac for it, I had reported and submitted a patch - perhaps it is
a similar issue raising its head again in v1.2

HTH
Tarique

-- 
=
PHP for E-Biz: http://sanisoft.com
Cheesecake-Photoblog: http://cheesecake-photoblog.org
=

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



requestAction issue when using a plugin

2007-01-30 Thread Doug

I am using Cake 1.1.12.4205 calling a plugins action:

/catalog/search/General/
///

All works fine. I add the following line to my default layout:

requestAction("Menu/display/main_menu",
array( "return"=>true ) ); ?>

Where the Menu controller is 'not' a plugin. It is a regular
controller. Still everything works fine.

Now I add the above line of code to the layout again, so it looks
like:

requestAction("Menu/display/main_menu",
array( "return"=>true ) ); ?>
requestAction("Menu/display/main_menu",
array( "return"=>true ) ); ?>

Strangely, the first one works, the second one doesn't!


I don't understand cake's inner workings yet, but I think the problem
may be in:
/cake/dispatcher.php - Line 92
if (!loadController($ctrlName)) {

This line seems to try to load a controller. If it returns false, it
is assumed that this is a plugin. However it also returns false when
the controller has already been loaded.

So in my above example, it that line returns false the 2nd time I call
requestAction and the dispatcher believes that my regular Menu
controller is a Menu plugin controller (which it is not).

To further complicate things, I couldn't just return true from
loadController if the controller has already been loaded, because it
will return true if a plugin controller has already been loaded, then
it will think that already loaded plugins are just regular
controllers.


I'm pretty new, so if this is a bug I will look for a way to report
it, but maybe I am just misunderstanding something.

Doug


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---