Seems like two variables in a function should be local, not global. This patch fixes that.

diff --git a/js/pattern.js b/js/pattern.js
index 8b0d120..05b8e6e 100644
--- a/js/pattern.js
+++ b/js/pattern.js
@@ -21,8 +21,8 @@
       $.each(settings.commerce_bpc, function (source_id, options) {
         $(options.target_wrapper).hide();
         $(source_id, context).bind('change keyup', function() {
-          target = $(options.target, context);
-          target_wrapper = $(options.target_wrapper, context);
+          var target = $(options.target, context);
+          var target_wrapper = $(options.target_wrapper, context);
           if ($(this).is(':disabled') || $(this).val() == '') {
             target_wrapper.hide();
           }

Please close this if I misunderstood something, I am new to Drupal.

CommentFileSizeAuthor
avoid-leakage.patch654 bytesolleolleolle
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sven.lauer’s picture

Status: Active » Fixed

Nice catch.

Committed and pushed to 1.x and 2.x. Thanks!

Status: Fixed » Closed (fixed)

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