Commit 8b66c0c
committed
Fix undefined array key 'price' error in Product::variantOptions()
Between October and November 2024, PHPUnit was upgraded from 10.x to 11.x,
which introduced stricter error handling for undefined array keys. This caused
tests to fail when accessing $variantOption['price'] for variant options that
don't have a price key defined.
The fix uses the null coalescing operator to provide a default null value
when the 'price' key is not present, matching the pattern already used for
the 'stock' key on line 139.
This resolves 35 failing tests in the MigrateProductTypeTest suite and
other tests that create variant options without price values.1 parent 985528b commit 8b66c0c
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
| 136 | + | |
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| |||
0 commit comments