ConnectionManager::getDataSource, it seems like the name parameter is
an empty string.
The error I get is:
Notice (8): Trying to get property of non-object [CORE/cake/libs/model/
datasources/dbo_source.php, line 673]
Code | Context
$this = DboMysql
DboMysql::$description = "MySQL DBO Driver"
DboMysql::$_baseConfig = array
DboMysql::$startQuote = "`"
DboMysql::$endQuote = "`"
DboMysql::$_useAlias = true
DboMysql::$_commands = array
DboMysql::$columns = array
DboMysql::$index = array
DboMysql::$alias = "AS "
DboMysql::$fieldCache = array
DboMysql::$__bypass = false
DboMysql::$__sqlOps = array
DboMysql::$connected = true
DboMysql::$fullDebug = false
DboMysql::$error = NULL
DboMysql::$affected = 1
DboMysql::$numRows = 1
DboMysql::$took = 0
DboMysql::$_result = resource
DboMysql::$_queriesCnt = 0
DboMysql::$_queriesTime = NULL
DboMysql::$_queriesLog = array
DboMysql::$_queriesLogMax = 200
DboMysql::$_queryCache = array
DboMysql::$__descriptions = array
DboMysql::$_sources = array
DboMysql::$connection = resource
DboMysql::$config = array
DboMysql::$configKeyName = "default"
DboMysql::$_transactionStarted = false
DboMysql::$cacheSources = true
DboMysql::$_log = NULL
DboMysql::$results = resource
DboMysql::$map = array
DboMysql::$__booleans = array
$model = User
User::$name = "User"
User::$validate = array
User::$hasOne = array
User::$hasMany = array
User::$useDbConfig = "default"
User::$useTable = "users"
User::$displayField = "name"
User::$id = false
User::$data = array
User::$table = "users"
User::$primaryKey = "id"
User::$_schema = array
User::$validationErrors = array
User::$tablePrefix = ""
User::$alias = "User"
User::$tableToModel = array
User::$logTransactions = false
User::$transactional = false
User::$cacheQueries = false
User::$belongsTo = array
User::$hasAndBelongsToMany = array
User::$actsAs = NULL
User::$Behaviors = BehaviorCollection object
User::$whitelist = array
User::$cacheSources = true
User::$findQueryType = "first"
User::$recursive = 1
User::$order = NULL
User::$__exists = NULL
User::$__associationKeys = array
User::$__associations = array
User::$__backAssociation = array
User::$__insertID = NULL
User::$__numRows = NULL
User::$__affectedRows = NULL
User::$_findMethods = array
User::$_log = NULL
User::$Structure = Structure object
User::$Author = NULL
$queryData = array(
"conditions" => array(
"User.id" => "178"
),
"fields" => array(
"`User`.`id`",
"`User`.`name`",
"`User`.`surname`",
"`User`.`username`",
"`User`.`password`",
"`User`.`email`"
),
"joins" => array(
array()
),
"limit" => 1,
"offset" => array(),
"order" => array(
null
),
"page" => 1,
"group" => array(),
"callbacks" => true
)
$recursive = null
$null = null
$array = array()
$linkedModels = array(
"hasOne/Author" => true
)
$_associations = array(
"belongsTo",
"hasOne",
"hasMany",
"hasAndBelongsToMany"
)
$type = "hasOne"
$assocData = array(
"className" => "Author",
"foreignKey" => "user_id",
"dependent" => false,
"conditions" => "",
"fields" => "",
"order" => "",
"limit" => "",
"offset" => "",
"exclusive" => "",
"finderQuery" => "",
"counterQuery" => ""
)
$assoc = "Author"
$linkModel = null
$external = false
$query = "SELECT `User`.`id`, `User`.`name`, `User`.`surname`,
`User`.`username`, `User`.`password`, `User`.`email`,
`User`.`user_ip`, `User`.`isAdmin` FROM `users` AS `User` WHERE
`User`.`id` = 178 LIMIT 1"
$resultSet = array(
array(
"User" => array(),
"Author" => array()
)
)
$filtered = array(
"Structure"
)
$db =& $this;
} else {
$db =&
ConnectionManager::getDataSource($linkModel->useDbConfig);
DboSource::read() - CORE/cake/libs/model/datasources/dbo_source.php,
line 673
Model::find() - CORE/cake/libs/model/model.php, line 2031
AppController::beforeRender() - APP/app_controller.php, line 107
Controller::render() - CORE/cake/libs/controller/controller.php, line
763
ErrorHandler::_outputMessage() - CORE/cake/libs/error.php, line 373
ErrorHandler::missingTable() - CORE/cake/libs/error.php, line 224
Object::dispatchMethod() - CORE/cake/libs/object.php, line 118
ErrorHandler::__construct() - CORE/cake/libs/error.php, line 118
Object::cakeError() - CORE/cake/libs/object.php, line 203
Model::setSource() - CORE/cake/libs/model/model.php, line 779
Model::__construct() - CORE/cake/libs/model/model.php, line 439
ClassRegistry::init() - CORE/cake/libs/class_registry.php, line 148
Model::__constructLinkedModel() - CORE/cake/libs/model/model.php, line
666
Model::__generateAssociation() - CORE/cake/libs/model/model.php, line
751
Model::__createLinks() - CORE/cake/libs/model/model.php, line 640
Model::__construct() - CORE/cake/libs/model/model.php, line 447
ClassRegistry::init() - CORE/cake/libs/class_registry.php, line 140
Model::__constructLinkedModel() - CORE/cake/libs/model/model.php, line
666
On May 26, 1:37 pm, John Andersen <j.andersen...@gmail.com> wrote:
> Please provide full information on your issue :)
>
> What error message are you receiving?
> How does your find statement look like?
> Do you use the Containable behaviour?
>
> Then maybe we will better be able to assist you in solving your
> issue :)
> Enjoy,
> John
>
> On May 26, 1:39 pm, Paolo <pao...@gmail.com> wrote:
>
> > PS: I talked about the habtm relationship because if i remove that
> > relation everything works well.
>
> > On May 26, 12:37 pm, Paolo <pao...@gmail.com> wrote:
>
> > > Hi all, I have a problem in a project I'm working on. I have a table
> > > Users with two hasOne relationships with Author and Manager. The
> > > Author table has a htbm relation with another table. The problem I'm
> > > facing is that when querying on the users table, if there is no
> > > related author (an acceptable scenario in my case), cakes returns an
> > > error, specifically in the connection_manager -> getDataSource
> > > function. Do you know how can I avoid this error?
> > > I'm usign cake 1.2.6.
>
> > > Thanks
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:
Post a Comment