Error in commit #5bebe24f?

Created on 20 January 2023, almost 2 years ago
Updated 1 April 2023, over 1 year ago

Problem/Motivation

Using current dev of this module, purchase order number is not being populated in various places, e.g.:

  • /checkout/NNN/review
  • /admin/commerce/purchase-orders

Steps to reproduce

Create an order using "new purchase order" as payment, enter a p.o. number, then click "continue to review." PO number is not shown, just the prefix "Purchase Order#" without the number.

Proposed resolution

The problem appears to be a typo in line 28 of /src/Plugin/Commerce/PaymentMethodType:

28    if ($payment_method->hasField('label')) {
29      $label = $payment_method->po_number->value;
30    }

It should be:

28    if ($payment_method->hasField('po_number')) {
29      $label = $payment_method->po_number->value;
30    }

Because there's no "label" field, line 29 is skipped and the $label variable is never populated. The change appears to have been made in commit #5bebe24f on Oct. 22, 2022.

Remaining tasks

Patch to follow; review and commit.

User interface changes

None

API changes

None

Data model changes

None

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States rclemings

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024