In detail this is the message Drupal comes up :
user warning: 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 ') AND ec_receipt_allocation.type = 'transaction' LEFT JOIN Drupal_ec_workflow_s' at line 6 query: SELECT COUNT(*) FROM (SELECT ec_transaction.txnid AS txnid FROM Drupal_ec_transaction ec_transaction INNER JOIN Drupal_ec_customer ec_customer ON ec_transaction.ecid = ec_customer.ecid LEFT JOIN Drupal_users users_ec_customer ON ec_customer.uid = users_ec_customer.uid LEFT JOIN Drupal_ec_transaction_address ec_transaction_address ON ec_transaction.txnid = ec_transaction_address.txnid LEFT JOIN Drupal_ec_receipt_allocation ec_receipt_allocation ON ec_transaction.txnid = CAST(ec_receipt_allocation.etid AS INT) AND ec_receipt_allocation.type = 'transaction' LEFT JOIN Drupal_ec_workflow_statuses ec_workflow_statuses ON ec_transaction.workflow = ec_workflow_statuses.workflow WHERE (ec_transaction_address.type IN ('billing') OR ec_transaction_address.type IS NULL) AND (ec_receipt_allocation.erid = 24) ) count_alias in E:\htdocs\Drupal11\sites\all\modules\extensions\views\includes\view.inc on line 739.
What really matters is:
CAST(ec_receipt_allocation.etid AS INT)
this causes the error und should be instead:
CAST(ec_receipt_allocation.etid AS unsigned INT)
in ec_store.view.inc line 324 I found:
$data['ec_receipt_allocation']['table']['join'] = array(
'ec_transaction' => array(
'handler' => 'ec_receipt_views_join_cast',
'left_field' => 'txnid',
'field' => 'etid',
'cast' => array('type' => 'int'),
'type' => 'LEFT',
'extra' => array(
array(
'field' => 'type',
'value' => 'transaction',
),
),
),
);
But correcting the cast to 'unsigned int' is blocked in ec_receipt.views.inc line 344:
function cast_field_spec($field, $spec) {
if (!isset($spec['size'])) {
$spec['size'] = 'normal';
}
$map = db_type_map();
$cast = $map[$spec['type'] .':'. $spec['size']];
if (isset($spec['length'])) {
$cast .= '('. $spec[length] .')';
}
elseif (isset($spec['precision']) && isset($spec['scale'])) {
$cast .= '('. $spec['precision'] .', '. $spec['scale'] .')';
}
return "CAST($field AS $cast)";
}
db_type_map() can't handle 'unsigned int' and returns nothing instead.
Please insert a handling for 'unsigned int' to avoid this failure.
Comment | File | Size | Author |
---|---|---|---|
#4 | ecommerce-ec_receipt_views_inc-652858.patch | 1.1 KB | Soren Jones |
#2 | ecommerce-ec_receipt_views_inc-652858.patch | 1.1 KB | Soren Jones |
Comments
Comment #1
EPO CreditAttribution: EPO commentedThis isnt brilliant programming but it suffices to work:
Comment #2
Soren Jones CreditAttribution: Soren Jones commentedCode above attached as patch for review.
Comment #3
Soren Jones CreditAttribution: Soren Jones commentedCode above attached as patch for review.
Comment #4
Soren Jones CreditAttribution: Soren Jones commentedDidn't attach properly?
Comment #5
gordon CreditAttribution: gordon commentedThanks committed to dev