I have run into a problem on Drupal 7 trying to bulk edit themes on my site using Domain Access. Most of the other features of Domain Access 7.x seem to be working.

I did disable and uninstall Domain Theme module, but upon enabling again, the problem returned.

PHP Version: 5.2.15
MySQL Version: 5.1.52
Drupal Version: 7.0
Domain Version: 7.x-2.12
URL: http://example.com/admin/structure/domain/batch/site_theme

Error Message:

* Notice: Array to string conversion in DatabaseStatementBase->execute() (line 2039 of /public_html/example.com/includes/database/database.inc).
* PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' 'atlanta.example.com', 'Atlanta Example', 'http', '1', 'http://atlanta.example.com/', '1' at line 1: SELECT domain_id, theme, settings, status FROM {domain_theme} WHERE domain_id = :domain_id_domain_id, :domain_id_subdomain, :domain_id_sitename, :domain_id_scheme, :domain_id_valid, :domain_id_path, :domain_id_site_grant, :domain_id_aliases AND status = 1; Array ( [:domain_id_domain_id] => 3 [:domain_id_subdomain] => atlanta.example.com [:domain_id_sitename] => Atlanta Example [:domain_id_scheme] => http [:domain_id_valid] => 1 [:domain_id_path] => http://atlanta.example.com/ [:domain_id_site_grant] => 1 [:domain_id_aliases] => Array ( ) ) in domain_theme_lookup() (line 135 of /public_html/example.com/sites/all/modules/domain/domain_theme/domain_theme.module).

CommentFileSizeAuthor
#4 1125520-wrburgess-theme-llokup.patch1000 bytesagentrickard

Comments

agentrickard’s picture

Thanks. Nice report.

agentrickard’s picture

Issue tags: -domain, -domain access

Removed redundant tags.

wrburgess’s picture

FYI, if you cannot reproduce the error, I can give you access to this install. It's just a sandbox site to compare Domain Access between Drupal 6 and Drupal 7.

agentrickard’s picture

Status: Active » Needs review
StatusFileSize
new1000 bytes

Confirmed. We were violating our own internal API:

 * - '#lookup' [optional] Used with the 'custom' #domain_action to perform a default value lookup against a custom function.
 * This value should be a valid function name.  Your function must accept the $domain array as a parameter.

The attached should fix it by using a wrapper around the lookup. I wonder if this is broken in D6?

wrburgess’s picture

I've used bulk theme editing on D6 and did not receive any errors.

D6 has been rock solid for us with Domain Access. Thanks for all the work you do on it.

agentrickard’s picture

Status: Needs review » Fixed

Committed to 7.x.3 and 7.x.2, but then I found #1139288: domain_theme_batch() doesn't use DBTNG, and I don't understand why we didn;t catch that one yet/.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.