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
Comment #1
rszrama CreditAttribution: rszrama commentedI'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?
Comment #2
Markus1972 CreditAttribution: Markus1972 commentedThis 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?
Comment #3
rszrama CreditAttribution: rszrama commentedYes, 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.
Comment #4
bojanz CreditAttribution: bojanz at Centarro commented