In PurchasedEntityAvailableConstraintValidator::validate(), the first line makes the following assertion:

assert($value instanceof EntityReferenceFieldItemListInterface);

This works when the validation is done when attached to the purchasable entity field, which is a entity reference field.

In some scenarios, the validation is placed on the Quantity field, though, which causes the assertion to fail, even though the code still completes successfully. This also causes a Warning.

This is a simple change to make the assertion check for FieldItemListInterface instead.

CommentFileSizeAuthor
#2 loosen-strict-assert-3303442-2.patch1.64 KBtomtech

Comments

TomTech created an issue. See original summary.

tomtech’s picture

StatusFileSize
new1.64 KB
tomtech’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 2: loosen-strict-assert-3303442-2.patch, failed testing. View results

tomtech’s picture

Status: Needs work » Needs review

jsacksick’s picture

Status: Needs review » Fixed

Committed, thanks!

Status: Fixed » Closed (fixed)

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