Fatal error: Cannot use object of type stdClass as array in E:\Dev sites\fangbianwang\sites\all\modules\domain\domain.module on line 1080
here is the code in domain.module
// Did we get a valid result?
->1080 if (isset($domain['domain_id'])) {
->1081 // Let Domain Access module extensions act to override the defaults.
->1082 $domains[$key] = domain_api($domain, $reset);
->1083 }
->1084 else {
->1085 $domains[$key] = -1;
->1086 }
cause error when enable the domain access module use oracle driver , use mysql database is ok.
windows 8
apache 2.2.22
php 5.3.13
oracle 11g express
OCI8 Support: enabled
Version : 1.4.7
Revision: $Id: bf2eaf558b050b6d2e6d098bed6345af7e842ea4 $
Active Persistent Connections : 0
Active Connections: 0
Oracle Run-time Client Library Version: 11.2.0.3.0
Oracle Instant Client Version : 10.2
Temporary Lob support : enabled
Collections support : enabled
| Comment | File | Size | Author |
|---|
Comments
Comment #1
shoufeng.xi commentedbut use mysql $domain is null
Comment #2
agentrickardThe problem is likely caused by mishandling of this query (line 1057).
So here we are trying to return an array or arrays, which is not the standard PDO behavior, but is supported by the API.
Comment #3
shoufeng.xi commentedso what should to do? I'm not familiar with code. and why there is no error use mysql.
update: and you said It's oracle driver bug in another duplicate issue I post.
update:
$result = db_query("SELECT domain_id, subdomain, sitename, scheme, valid, weight, is_default, machine_name FROM {domain}", array(), array('fetch' => PDO::FETCH_ASSOC))->fetchAllAssoc('domain_id');$result return different use oracle or mysql
mysql
but oracle
Comment #4
shoufeng.xi commentedchange
$result = db_query("SELECT domain_id, subdomain, sitename, scheme, valid, weight, is_default, machine_name FROM {domain}", array(), array('fetch' => PDO::FETCH_ASSOC))->fetchAllAssoc('domain_id');to
$result = db_query("SELECT domain_id, subdomain, sitename, scheme, valid, weight, is_default, machine_name FROM {domain}", array(), array('fetch' => PDO::FETCH_ASSOC))->fetchAllAssoc('domain_id',PDO::FETCH_ASSOC);It's work!
=================================
update: not work!
use oracle return:
mysql return:
help!!!!!!!!!!!!!!!!!!!!!
Comment #5
shoufeng.xi commentedI look up the database
the domain table have one record. in mysql domain_id value is 1, in oracle domain_id value is 0.
I manually change it to 1; It work ! strange !!
need help!!
update:0 is the default value in the schema
Comment #6
agentrickardThere is no error in MySQL or PostGreSQL of MSSQl because they handle the PDO construction as expected. This needs to be fixed by the Oracle driver code.
Either that or the Oracle version is doing odd things to the id.
But since Drupal core doesn't support Oracle, this is the best place to get help.
Comment #7
bohartD7 reached its EOL back in January 2025, and there is no active release for D7 for this module anymore.
Development or support is not planned for D7. All D7-related issues are marked as outdated in a bunch.
Everyone can apply the patches/suggestions above (not tested by the maintainers, tested by the community) to their D7 projects.
If the issue remains relevant for D10+ versions, merge requests with proposed solutions for a new module version (D10+) are welcome in a new follow-up issue.
Thanks!