Consider purchased entity can be NULL

Created on 22 April 2022, about 3 years ago
Updated 14 May 2025, 8 days ago

Problem/Motivation

The current implementation considers that an order item necessarily has a purchased entity. This is not always the case (Special order item type, product deleted whilst ongoing cart...)

Steps to reproduce

Create a new order item type with no purchasable entity type. Add an order item of that type to an order and save. Some warning messages are thrown.

Proposed resolution

Check that the purchasable entity of an order item exists before using it.

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡¨πŸ‡­Switzerland corwino

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