Trying both 1.1.15.5144 and 1.2.0.5146alpha, and svn trunk, I cannot
get a simple, two-table app with only scaffolding to work properly. No
one on IRC has been able to help either.
I am using postgresql, with two tables: tournaments -> draws
My models are:
class Draw extends AppModel
{
var $name = 'Draw';
var $belongsTo = array(
'Tournament' => array(
'className' => 'Tournament',
'foreignKey' => 'tournament_id'
)
);
}
class Tournament extends AppModel
{
var $name = 'Tournament';
var $hasMany = array(
'Draw' => array(
'className' => 'Draw',
'dependent' => true,
'foreign_key' => 'tournament_id'
)
);
}
I am just using scaffolding, but anytime the code tries to read the
Tournament, the database object seems to close automatically (causing
the SQL log table to be displayed at the top of the page, instead of
the end). As a result, the edit pages are broken.
I added a debug_print_backtrace() to DBO_Source::destruct(), and it
shows this:
#0 DboSource->__destruct() called at [cake/libs/model/model.php:1451]
#1 DboSource->read(Tournament Object ([name] => Tournament,[hasMany]
=> Array ([Draw] => Array ([className] => Draw,[dependent] => 1,
[foreign_key] => tournament_id,[foreignKey] => tournament_id, ...)
called at [cake/libs/model/model.php:1451]
#2 Model->findAll(Array ([Tournament.id] => 3), , , 1, , ) called at
[cake/libs/model/model.php:1378]
#3 Model->find(Array ([Tournament.id] => 3), ) called at [cake/libs/
model/model.php:947]
#4 Model->read() called at [cake/libs/controller/scaffold.php:225]
#5 Scaffold->__scaffoldView(Array ([controller] => tournaments,
[action] => view, ...) called at [cake/libs/controller/scaffold.php:
454]
...
No other error messages are displayed, so I cannot find the cause of
this problem. I am thinking it may be an issue with postgresql, but
I'm not sure. I am hoping a developer would be able to figure out why
this would happen. Or perhaps it's a problem with my code I cannot
see.
(I am running SVN trunk for now)
I made a ticket on the trac about this before I realized that there
was a google group for cakephp, so please disregard that.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---