This is a really minor issue but displaying a load of error messages. For items that are actually 0 sometimes you can receive the following warning messages.

Notice: Undefined index: weight in physical_weight_convert() (line 578 of /modules/patch/physical/physical.module).

The reason being is that sometimes modules passes an empty array or an array that does not have a $weight['weight'] field.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ShaneOnABike’s picture

Status: Active » Needs review
FileSize
427 bytes

Here's the patch for anyone that wants to implement it. I simply just returned an array with the correct values (i.e. an empty weight).

ShaneOnABike’s picture

Sorry this one is better!

torgosPizza’s picture

Status: Needs review » Reviewed & tested by the community

This looks good to me, assuming there are no unintended consequences, but I doubt there are many. We sell file downloads mainly, and I'd like to not have a bunch of Notice errors in our logs :)

rszrama’s picture

Issue summary: View changes
FileSize
665 bytes

I moved this up above the unit check to ensure the empty($weight) check runs before the unit type comparison. Added some comments as well.

rszrama’s picture

Status: Reviewed & tested by the community » Fixed

Aaaand committed. Thanks!

  • rszrama committed 339a993 on 7.x-1.x authored by ShaneOnABike
    Issue #1887116 by ShaneOnABike, rszrama: check for a properly formed...

Status: Fixed » Closed (fixed)

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