Problem/Motivation

Was building a cart programatically and got this nice error when going to the cart page after:

Warning: Invalid argument supplied for foreach() in commerce_discount_remove_discount_components() (line 91 of ./commerce_discount/commerce_discount.module).

Proposed resolution

Cast and initialize components array like commerce_cart.module:1119 does.

Remaining tasks

User interface changes

API changes

Comments

joelpittet’s picture

Title: Exxception Unknown data property commerce_coupons » Warning: Invalid argument supplied for foreach
Issue summary: View changes
joelpittet’s picture

Status: Active » Needs review
StatusFileSize
new819 bytes
deggertsen’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new623 bytes

Patch in #2 is good but doesn't apply using git. Here's a rerolled patch that should work.

Also marking RTBC as it appears to work and the logic makes sense.

joelpittet’s picture

Oh thanks, sorry my bad, forgot --relative on this one:)

bojanz’s picture

Status: Reviewed & tested by the community » Fixed

Committed, thanks!

  • bojanz committed 6b7c856 on 7.x-1.x authored by joelpittet
    Issue #2444697 by joelpittet, deggertsen: Warning: Invalid argument...

Status: Fixed » Closed (fixed)

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