In the original commerce_customer around line 325 the below commented out where clause was used.
This however does not play nice with the mssql driver (Array to string conversion error)
The below code including the top line that says implode fixes this.
---------------------
$profile_type_values = "'" . implode("','", array_keys($profile_types)) . "'";

// Ensure each profile's current revision is also disabled.
$query = db_update('commerce_customer_profile_revision')
->fields(array('status' => 0))
->where('revision_id IN (SELECT revision_id FROM {commerce_customer_profile} WHERE type IN (:profile_types))', array(':profile_types' => $profile_type_values))
// ->where('revision_id IN (SELECT revision_id FROM {commerce_customer_profile} WHERE type IN (:profile_types))', array(':profile_types' => array_keys($profile_types)))
->execute();

Comments

rszrama’s picture

Title: array to string conversion error » MSSQL array to string conversion error
Version: 7.x-1.11 » 7.x-1.x-dev
Category: Bug report » Task
Status: Active » Postponed (maintainer needs more info)
Issue tags: -string to array mssql

I'm not sure why this is an issue with our query - can you elaborate? Shouldn't the issue really be addressed in the MSSQL driver to properly convert arrays to strings in token replacement?

Markus1972’s picture

This query triggers the problem, as i said in my post, the mssql driver is the problem. Maybe the bug should be reposted to the mssql driver?

rszrama’s picture

Yes, that's what I'm saying. The query itself, even if it triggers the error, looks like a legitimate use of the database abstraction layer. I believe the bug exists in the MSSQL driver, but I don't know where such things are reported. If that sounds reasonable to you, just update the Project of this issue in a follow-up comment to the appropriate project.

bojanz’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)