Notice: Undefined variable: mailManager in Drupal\uc_order\Form\MailInvoiceForm->__construct()

This was a result of the refactoring I did as part of #2927419: Dependency injection for Forms. The fact that this error got put in exposed the fact that we don't have any tests for the "Invoice" tab on the order administration page. This tab lets the administrator View, Print, and Email invoices.

So first, here's a set of tests for these three invoice functions. THESE TESTS SHOULD FAIL because of the bug. Then I will upload a patch that contains both a fix for the bug AND the tests, and that should work, demonstrating that the tests will catch the bug (and many other problems as well).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

TR created an issue. See original summary.

TR’s picture

Issue summary: View changes
TR’s picture

And here's the patch with the fix and the tests.

The last submitted patch, order-invoice-tests.patch, failed testing. View results

  • TR committed 8f86231 on 8.x-4.x
    Issue #2933698 by TR: Error when visiting /admin/store/orders/{uc_order...
TR’s picture

Issue summary: View changes
Status: Needs review » Fixed

OK, first one failed as expected, second one passed as expected. Committed fix and tests.

Status: Fixed » Closed (fixed)

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