Hi,
I just encountered a strange one.
Well, I got the error earlier this week but have only now taken the
time to break it down.

I have a shell that just calls requestAction to run an action. When I
run the action in the browser, all is well.
When I run it via the shell I get strange results. Turns out that
$this->ModelName is an instance of AppModel, not of ModelName, when
called from the shell. My errors were the cause of both custom find
variations missing and before and after find callbacks not firing.

I created a syntax error in my model file and the shell returned the
same as always but the browser halted and pointed out the syntax
error, as expected. So the Model file is not even included when the
shell runs.

I have a similar call to another action with another model but
basically the same setup. That one works fine but I cant see any
difference that should be at all related.

Doing App::import and creating a new instance on my model at the top
of my action makes the logic work. It is just such a bizarre error
that I had to ask if anyone has seen anything similar or have any clue
what the cause is?

I have ruled out the following...
Can't be file permissions (since the class loads fine with
App::import)
Can't be a general CakePHP bug since my other similar setup loads as
expected.
Can't be a normal bug of mine since it all works in the browser.

This is like a common problem with Actionscript/Flash. Flash reports
an object ready before it really is and calling it will trigger
methods on parent-classes in a semi-random way. I never had anything
like that happen in PHP.


that's all I have for now
Martin


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to