1. Create and pay for an order (I used the test gateway provided by uc_payment)
2. Go to the orders page and view the order. For example, admin/store/orders/9
3. Click "Payments", for example admin/store/orders/9/payments

You get this fatal:

Fatal error: Call to a member function label() on null in /Users/rfay/workspace/d8git/modules/ubercart/payment/uc_payment/src/Form/OrderPaymentsForm.php on line 92

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rfay created an issue. See original summary.

rfay’s picture

One little bit to add: I have #2695639-07: Zero price product generates error when checking out patching current dev.

TR’s picture

Seems to be a problem with the test gateway - I can't reproduce it with other payment methods / gateways.

We do have test cases for the OrderPaymentsForm, but it seems we only test with the 'check' payment method.

rfay’s picture

It does it on uc_stripe as well.

TR’s picture

My vague theory is that the test gateway is neglecting to do something that is assumed of gateways and that it doesn't inherit a default something from the CreditCardPaymentMethodBase. This could be the case for your uc_stripe as well ...

I'll be looking into this ...

rfay’s picture

I agree with your random theory :) Although I looked at the test gateway a bit, I mostly just inherited.

longwave’s picture

This is a configuration machine name vs plugin ID issue. uc_payment_enter() stores $method, aka "the payment method ID" in the database, but this has not been fully updated from D7 and so it is not exactly clear whether this should be a config ID or a plugin ID. At the moment most places assume this is a config ID, but this is problematic from within plugin classes and plugin instances do not know their parent configuration ID. Instead I am leaning towards storing the plugin ID (and serialized configuration) here, as then we can recreate the plugin afterwards, if we need to, without needing the config entity at all - this may be useful for e.g. refunding payments later while allowing payment methods to be deleted.

#2789967: Receive_check creates an "other" payment if check method label is not exactly "check" is related.

longwave’s picture

Status: Active » Needs review
FileSize
13.13 KB

We can create the plugin with no configuration data, all we really need is the label so this should be enough for now.

Status: Needs review » Needs work

The last submitted patch, 8: 2788963-uc_payment-plugin-label.patch, failed testing.

rfay’s picture

Status: Needs work » Needs review
FileSize
14.75 KB

Just took a look and tried to do this one like the other ones were done. I think the 3 'Simpletest' uc_payment_enter() were just overlooked. Just changed those 3 from 'Simpletest' to 'other' for the method (in CartCheckoutTest::testCheckoutComplete())

rfay’s picture

Also, @longwave, your patch fixes the OP in manual testing. Thanks!

  • longwave committed 57ba4cd on 8.x-4.x
    Issue #2788963 by rfay, longwave: Call to a member function label() on...
longwave’s picture

Status: Needs review » Fixed

Committed #10, thanks for finishing this off.

Status: Fixed » Closed (fixed)

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

kruser’s picture

--deleted--