Skip to content

[5.x] Conditionally add purchasable to line item’s extra fields, to prevent exceptions on to array#4340

Merged
nfourtythree merged 5 commits into
5.xfrom
nathaniel/com-592-5x-invalidconfigexception-when-calling-toarray-on-custom
Jul 21, 2026
Merged

[5.x] Conditionally add purchasable to line item’s extra fields, to prevent exceptions on to array#4340
nfourtythree merged 5 commits into
5.xfrom
nathaniel/com-592-5x-invalidconfigexception-when-calling-toarray-on-custom

Conversation

@nfourtythree

Copy link
Copy Markdown
Contributor

Related issues

#4337

@nfourtythree nfourtythree self-assigned this Jul 17, 2026
@nfourtythree
nfourtythree requested a review from a team as a code owner July 17, 2026 10:41
@linear-code

linear-code Bot commented Jul 17, 2026

Copy link
Copy Markdown

COM-592

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes an InvalidConfigException thrown when serializing custom LineItem instances by avoiding expansion of the purchasable extra field when the line item type is not purchasable (related to #4337).

Changes:

  • Make extraFields() include purchasable only for LineItemType::Purchasable line items.
  • Filter out the conditional null entry from the extra fields list.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/models/LineItem.php Outdated
Comment thread src/models/LineItem.php
@nfourtythree
nfourtythree merged commit c579dab into 5.x Jul 21, 2026
3 checks passed
@nfourtythree
nfourtythree deleted the nathaniel/com-592-5x-invalidconfigexception-when-calling-toarray-on-custom branch July 21, 2026 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants