Problem/Motivation

When visiting <site>/promtion/*/coupons the usage column is displaying the wrong usage number since in the code under Drupal\commerce_promotion\CouponListBuilder::load() line 76 we have $this->usageCounts = $this->usage->loadMultiple($coupons);.

Proposed resolution

Shouldn't we use $this->usageCounts = $this->usage->loadMultipleByCoupon($coupons); instead

Remaining tasks

Patch review

User interface changes

None

API changes

None

Data model changes

None

CommentFileSizeAuthor
#3 displaying_wrong_coupon-2919078-3.patch988 bytesnikathone

Comments

nikathone created an issue. See original summary.

nikathone’s picture

Status: Needs review » Active

Sorry this should be active. Uploading patch shortly.

nikathone’s picture

Status: Active » Needs review
StatusFileSize
new988 bytes

Here is the pull request https://github.com/drupalcommerce/commerce/pull/820 and patch attached.

nikathone’s picture

Issue summary: View changes
bojanz’s picture

Status: Needs review » Fixed

Thank you for catching and patching this!

  • bojanz committed 06069b6 on 8.x-2.x authored by nikathone
    Issue #2919078 by nikathone: Displaying wrong coupon usage number
    

Status: Fixed » Closed (fixed)

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