Problem/Motivation
Commerce Elavon provides payment method settings that toggle watchdog logging of request and response. The conditional to check these settings returns TRUE regardless of the setting so request and response is always logged to watchdog.
To recreate, complete a transaction using test gateway (haven't tested with live, but expect it is the same) and check watchdog output, request and response will be reported.
Proposed resolution
The comparison operator that checks the setting is ==
and its checking for a string 'request' or 'response', but when the logging is set to FALSE the value is integer 0. In this case, comparing int 0 with string will return TRUE, because PHP converts the string to the number 0, see http://stackoverflow.com/questions/6843030/why-does-php-consider-0-to-be....
Proposed solution: use comparison operator ===
.
Comment | File | Size | Author |
---|---|---|---|
#3 | commerce_elavon-fix-logging-conditional-2804981-3.patch | 1.07 KB | lwalley |
Comments
Comment #2
lwalley CreditAttribution: lwalley commentedComment #3
lwalley CreditAttribution: lwalley commentedComment #5
wuinfo - Bill Wu CreditAttribution: wuinfo - Bill Wu for Wulei Info Technology Solutions commentedThanks @lwalley,