Hi.
Sorry to bother you all again, but I've got a curious bug I just can't
fathom. In my /app/app_controller.php I've got the following code as
part of a routine that works out whether the user's logged in or not:
App::import('Model', 'Person');
$this->PersonTemp = new Person(); # This conflicts with webpages'
recursion, but not categories' recursion
For some reason I can't work out, the second of these two lines has
broken every page that uses the Webpage model I have. This is
confusing for several reasons: the two models are not directly related
in my ER diagram; I don't get an error message, the webserver just
doesn't return anything; and I have a model called Category which is
nearly identical to Webpage, but which works fine.
Through a bit of trial and error, I've found out that commenting out
the part of the Webpage model that deals with it being its own parent
and children (it recurses) makes the site work again, but I need this
functionality and it's an intriguing puzzle as to why it's not
working. Here's what I've commented out in /app/models/webpage.php to
temporarily fix it:
Class Webpage extends AppModel
{
var $name = 'Webpage';
var $belongsTo = array(
/* #This conflicts with the People model in app_controller
'Parent' => array(
'className' => 'Webpage'
)
*/
);
var $hasMany = array(
/* #This conflicts with the People model in app_controller
'Child' => array(
'className' => 'Webpage'
),
*/
'WebpageTranslation' => array(
'className' => 'WebpageTranslation'
)
);
}
I'm sure I've somehow managed to introduce a simple typo or something
somewhere, but does anyone have any ideas as to whereabouts the
trouble might lie?
Thank you very much,
Zoe.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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
-~----------~----~----~----~------~----~------~--~---