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 ===.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

lwalley created an issue. See original summary.

lwalley’s picture

Issue summary: View changes
lwalley’s picture

  • lwalley authored 29d8a54 on 7.x-1.x
    Issue #2804981 by lwalley: Request and response logged to watchdog even...
wuinfo - Bill Wu’s picture

Status: Active » Fixed

Thanks @lwalley,

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.