Closed (fixed)
Project:
e-Commerce
Component:
payment.module
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
2 Jun 2005 at 15:35 UTC
Updated:
12 Oct 2005 at 22:20 UTC
Jump to comment: Most recent file
I think this is a bug, I'vve been tracing through all the code to learn how everything works. My reports are based ont he 4.6.0 release of the e-commerce suite.
Below the $edit array is passed in to store_transaction_validate() along with $error. The output of this function overwrites $edit.
payment.module - line 387:
$edit = store_transaction_validate($edit, $error);
Looking at the code behind store_transaction_validate()
store.module - line 435:
function store_transaction_validate(&$edit) {
switch (strtoupper($edit['section'])) {
case 'OVERVIEW':
store_transaction_validate_overview($edit);
break;
case 'ADDRESSES':
store_transaction_validate_addresses($edit);
break;
case 'ITEMS':
store_transaction_validate_item($edit);
break;
default:
store_transaction_validate_overview($edit);
store_transaction_validate_addresses($edit);
store_transaction_validate_item($edit);
}
return ((form_get_errors()) ? false : true);
}
You can see that the above function is returning a BOOLEAN which in turn overwrites the $edit[] variable! Surely this can't be correct? Also, the store_transaction_validate() doesn't take a 2nd parameter, so I think the changes in payment.module should be something like:
$error = store_transaction_validate($edit);
Maybe i'm barking up the wrong tree though?
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | paymentmodule.diff | 375 bytes | budda |
Comments
Comment #1
buddaIs store_transaction_validate() supposed to return a BOOLEAN success flag (ie. FALSE if something failed validation), or a BOOLEAN to say if there were errors (ie. TRUE if there were errors) ?
Comment #2
buddaAttached MyFirstPatch™ to solve this problem.
Comment #3
matt westgate commentedPatch applied to 4.6 and HEAD. Thanks!
Comment #4
(not verified) commentedComment #5
(not verified) commentedComment #6
(not verified) commentedComment #7
Méléis commentedComment #8
(not verified) commentedComment #9
(not verified) commentedComment #10
(not verified) commentedComment #11
(not verified) commented