You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
When sylius admin orders page fetch orders, it joins unnecessary tables which makes query larger, heavier and longer.
Steps to reproduce
Visit /admin/orders/ page and check query created via doctrine.
For counting orders it selects all unnecessary order data + joins order items, products and product variants. This query requires only order id count and order state.
Displaying paginated order list. Same problem, fetches too much data + joins products and product variants.
Possible Solution
Changes must be made here: /Sylius/Bundle/CoreBundle/Doctrine/ORM/OrderRepository.php
From:
public function createSearchListQueryBuilder(): QueryBuilder
{
return $this->createListQueryBuilder()
->leftJoin('o.items', 'item')
->leftJoin('item.variant', 'variant')
->leftJoin('variant.product', 'product')
;
}
Thank you for raising this issue. You're right about this case.
We appreciate your engagement with the Sylius community, and we encourage you to open a pull request with your suggested changes to the code. This will allow us to review the changes and potentially merge them into the codebase 💃
Thank you again for your contribution to Sylius, and please let us know if you have any further questions or concerns 🚀
…lly (jakubtobiasz)
This PR was merged into the 1.13 branch.
Discussion
----------
| Q | A |
|-----------------|--------------------------------------------------------------|
| Branch? | 1.13
| Bug fix? | no/
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Related tickets | closes#14781
| License | MIT
Commits
-------
84738dd Add joins on the orders list conditionally
6bb765d Fix broken displaying customer's orders in the admin panel
Sylius version affected: 1.12.1
Description
When sylius admin orders page fetch orders, it joins unnecessary tables which makes query larger, heavier and longer.
Steps to reproduce
Visit
/admin/orders/
page and check query created via doctrine.Possible Solution
Changes must be made here:
/Sylius/Bundle/CoreBundle/Doctrine/ORM/OrderRepository.php
From:
To:
The text was updated successfully, but these errors were encountered: