Error: Call to a member function hasField() on bool

Created on 27 September 2021, about 3 years ago
Updated 1 September 2023, about 1 year ago

When I click the checkout button on the cart, I get a fatal PHP error.

The following message is added to the logs. Error: Call to a member function hasField() on bool in Drupal\commerce_donation_flow\Plugin\Commerce\CheckoutFlow\DonationCheckoutFlow->getSteps().

It appears that an item type of 'donation' is not included the order items. This causes the $donations array to be empty and consequently $donation is NULL rather than being an Order Item object. I'm unsure if this is a bug or if I'm misunderstanding how to use / configure the module.

I've configured the module following the steps outlined on the project page.

1. Donation flow I am using the configuration for Donation Flow checkout flow which was supplied by the module.

2. I am using the Default Order type and have configured it to use the Donation Flow checkout flow (screenshot 1)

3. Configure the Donation order item type. Set the order type configured above as the order type for Donation order items. (screenshot 2)

πŸ› Bug report
Status

Closed: works as designed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States Peter Caritas

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.

  • πŸ‡ΊπŸ‡ΈUnited States fathershawn New York

    The module having a custom checkout process causes confusion. I've added a configuration page to help with this in 1.1.x. The behaviors described are referring to the standard /cart to /checkout flow. I've also added an "add donation" pane for use in this standard flow.

Production build 0.71.5 2024