magento/magento2#39884: Fix type compatibility in Invoice comments me…#40428
Conversation
- Ensure getComments returns array and getCommentsCollection returns Collection to avoid type conflicts.
|
Hi @yaroslav-kozar. Thank you for your contribution!
Allowed build names are:
You can find more information about the builds here For more details, review the Code Contributions documentation. |
|
@magento run all tests |
|
@magento run all tests |
|
@magento run all tests |
engcom-Hotel
left a comment
There was a problem hiding this comment.
Hello @yaroslav-kozar,
Thank you for your contribution!
The changes seems good to us, but please look into the failed tests they seems to failing due to PR changes.
The failed functional tests are flaky.
Thank you
@engcom-Hotel @yaroslav-kozar I am taking care of the static test failure, as the PR has been pending since last week. |
|
@magento run all tests |
1 similar comment
|
@magento run all tests |
|
@magento run all tests |
|
@engcom-Hotel, I have fixed the Static tests failure. Could you please review the PR so we can proceed further? |
|
@magento run all tests |
engcom-Hotel
left a comment
There was a problem hiding this comment.
Failed tests seems flaky to me hence approving this PR
|
@magento run all tests |
|
Thanks for the collaboration & contribution! ✔️ QA Passed Preconditions: Manual Steps: Before After Builds are failed. Hence, moving this PR to Extended Testing. Thanks |
|
@magento run Functional Tests B2B, Functional Tests EE, Functional Tests CE, Integration Tests |
1 similar comment
|
@magento run Functional Tests B2B, Functional Tests EE, Functional Tests CE, Integration Tests |
3e216bf
into
magento:2.4-develop






Description (*)
Fixed a type compatibility issue in Magento\Sales\Model\Order\Invoice. The problem occurred when calling getComments() before addComment(). getComments() stores an array in the object's internal data, while getCommentsCollection() (called by addComment) expected a Collection object, leading to a fatal error.
Key changes:
Related Pull Requests
None
Fixed Issues (if relevant)
Manual testing scenarios (*)
Questions or comments
The fix ensures that the model correctly manages the transition between the Data Interface (arrays) and the Resource Model (collections).
Contribution checklist (*)