Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
testing this module I've found the next problem:
When I tryed to create a bulk product the next message was displayed and there was no token in the token area:
Notice: Undefined variable: return in _commerce_bpc_get_value() (line 462 of commerce_bpc.module)
Looking at the code, in commerce_bpc.module line 462 I've noticed that the return value was the following:
return $return;
At this point there is no $return variable defined so I changed this line to:
return $value;
Now it works fine and I've been able to create a bulk product.
Hope this helps.
Comments
Comment #1
redna CreditAttribution: redna commentedHi again,
having a better look to the code, I found that the following change would be better:
--- commerce_bpc.module 2011-07-23 08:35:36.000000000 +0200
+++ /var/tmp/commerce_bpc.module 2011-07-29 09:04:29.000000000 +0200
@@ -459,5 +459,8 @@
if (!$key_exists) {
$return = $default;
}
+ else{
+ $return = $value;
+ }
return $return;
}
Comment #2
sven.lauer CreditAttribution: sven.lauer commentedOr, even better: Rename "$value" to "$return", what it should have been in the first place.
Fixed. Thanks!
Comment #3
sven.lauer CreditAttribution: sven.lauer commented